Changeset 14440 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2018-11-22T00:06:51+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #17018 - NPE

Location:
trunk/src/org/openstreetmap/josm/data/projection/datum
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2Datum.java

    r13627 r14440  
    33
    44import java.io.IOException;
     5import java.util.Objects;
    56
    67import org.openstreetmap.josm.data.coor.LatLon;
     
    2526    public NTV2Datum(String name, String proj4Id, Ellipsoid ellps, NTV2GridShiftFileWrapper nadgrids) {
    2627        super(name, proj4Id, ellps);
    27         this.nadgrids = nadgrids;
     28        this.nadgrids = Objects.requireNonNull(nadgrids);
    2829    }
    2930
  • trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFileWrapper.java

    r13627 r14440  
    66import java.util.Collections;
    77import java.util.Map;
     8import java.util.Objects;
    89import java.util.TreeMap;
     10
     11import org.openstreetmap.josm.tools.Logging;
    912
    1013/**
     
    4346     */
    4447    public NTV2GridShiftFileWrapper(String filename) {
    45         this.gridFileName = filename;
     48        this.gridFileName = Objects.requireNonNull(filename);
    4649    }
    4750
     
    6568                }
    6669            }
     70            if (instance == null) {
     71                Logging.error("Unable to find NTV2 grid shift file for {0}", gridFileName);
     72            }
    6773        }
    6874        return instance;
Note: See TracChangeset for help on using the changeset viewer.