Issue #2596 - Add check for null coordinates.

Change-Id: I18f7a129ec428e51b36ac5b76cae194cf2c01e75

Former-commit-id: a6509aad8c [formerly a6509aad8c [formerly 11f3705080210161e6915309a4aec423b307cce8]]
Former-commit-id: 9754f0d8dd
Former-commit-id: ecb0d45b24
This commit is contained in:
Mike Duff 2014-02-18 17:32:32 -06:00
parent 3c9ebe52d3
commit 7ba61e6b53

View file

@ -127,6 +127,7 @@ import com.vividsolutions.jts.index.strtree.STRtree;
* or right click to select TimeSeries * or right click to select TimeSeries
* Jan 30, 2013 15646 wkwock Fix middle button drag map incorrect * Jan 30, 2013 15646 wkwock Fix middle button drag map incorrect
* Feb 05, 2013 1578 rferrel Changes for non-blocking singleton TimeSeriesDlg. * Feb 05, 2013 1578 rferrel Changes for non-blocking singleton TimeSeriesDlg.
* Feb 18, 2014 2596 mpduff Check for null coordinates.
* *
* </pre> * </pre>
* *
@ -143,9 +144,9 @@ public class MultiPointResource extends
private static class HydroImageMakerCallback implements private static class HydroImageMakerCallback implements
IRenderedImageCallback { IRenderedImageCallback {
private String dispClass; private final String dispClass;
private RGB color; private final RGB color;
private HydroImageMakerCallback(String dispClass, RGB color) { private HydroImageMakerCallback(String dispClass, RGB color) {
this.dispClass = dispClass; this.dispClass = dispClass;
@ -208,9 +209,9 @@ public class MultiPointResource extends
private static final RGB LABEL_COLOR = RGBColors.getRGBColor("White"); private static final RGB LABEL_COLOR = RGBColors.getRGBColor("White");
private Map<String, Map<RGB, IImage>> imageMap = new HashMap<String, Map<RGB, IImage>>(); private final Map<String, Map<RGB, IImage>> imageMap = new HashMap<String, Map<RGB, IImage>>();
private Map<String, GageData> dataMap = new HashMap<String, GageData>(); private final Map<String, GageData> dataMap = new HashMap<String, GageData>();
private STRtree strTree = new STRtree(); private STRtree strTree = new STRtree();
@ -895,6 +896,7 @@ public class MultiPointResource extends
public Map<String, Object> interrogate(ReferencedCoordinate rcoord) public Map<String, Object> interrogate(ReferencedCoordinate rcoord)
throws VizException { throws VizException {
List<GageData> gageDataList = pdcManager.getObsReportList(); List<GageData> gageDataList = pdcManager.getObsReportList();
try { try {
GageData selected = null; GageData selected = null;
Coordinate coord = rcoord.asLatLon(); Coordinate coord = rcoord.asLatLon();
@ -905,7 +907,7 @@ public class MultiPointResource extends
if ((gageDataList != null) && (gageDataList.size() > 0)) { if ((gageDataList != null) && (gageDataList.size() > 0)) {
for (GageData gd : gageDataList) { for (GageData gd : gageDataList) {
if (gd.isUse()) { if (gd.isUse() && gd.getCoordinate() != null) {
double[] gagePoint = descriptor double[] gagePoint = descriptor
.worldToPixel(new double[] { .worldToPixel(new double[] {
gd.getCoordinate().x, gd.getCoordinate().x,