Ignore:
Timestamp:
2017-03-31T00:08:09+02:00 (7 years ago)
Author:
Don-vip
Message:

sonar - squid:S2259 - Null pointers should not be dereferenced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java

    r11559 r11796  
    184184                case SUCCESS:
    185185                    handleNoTileAtZoom();
    186                     int httpStatusCode = attributes.getResponseCode();
    187                     if (httpStatusCode >= 400 && !isNoTileAtZoom()) {
    188                         if (attributes.getErrorMessage() == null) {
    189                             tile.setError(tr("HTTP error {0} when loading tiles", httpStatusCode));
    190                         } else {
    191                             tile.setError(tr("Error downloading tiles: {0}", attributes.getErrorMessage()));
     186                    if (attributes != null) {
     187                        int httpStatusCode = attributes.getResponseCode();
     188                        if (httpStatusCode >= 400 && !isNoTileAtZoom()) {
     189                            if (attributes.getErrorMessage() == null) {
     190                                tile.setError(tr("HTTP error {0} when loading tiles", httpStatusCode));
     191                            } else {
     192                                tile.setError(tr("Error downloading tiles: {0}", attributes.getErrorMessage()));
     193                            }
     194                            status = false;
    192195                        }
    193                         status = false;
    194196                    }
    195197                    status &= tryLoadTileImage(object); //try to keep returned image as background
Note: See TracChangeset for help on using the changeset viewer.