Ticket #2176: Fix WMS Error.patch

File Fix WMS Error.patch, 944 bytes (added by xeen, 16 years ago)

Additional check if the cached image was initalized properly

  • wmsplugin/src/wmsplugin/GeorefImage.java

     
    6161        // Width and height flicker about 2 pixels due to rounding errors, typically only 1
    6262        int width = Math.abs(maxPt.x-minPt.x);
    6363        int height = Math.abs(minPt.y-maxPt.y);
    64         int diffx = reImgHash.width - width;
    65         int diffy = reImgHash.height - height;
    66 
     64        int diffx, diffy;
     65        try {
     66            diffx = reImgHash.width - width;
     67            diffy = reImgHash.height - height;
     68        } catch(Exception e) {
     69            reImgHash = new Dimension(0, 0);
     70            diffx = 99;
     71            diffy = 99;
     72        }
    6773        // This happens if you zoom outside the world
    6874        if(width == 0 || height == 0)
    6975            return false;