# HG changeset patch # User Björn Ricks # Date 1350385606 -7200 # Node ID 3245bb4d600bf194914cc258914ff00f10f02af9 # Parent 5ff3b2f5fb1c1e70c4726239e4a6fab8d1e61a6f Avoid possible NullPointerException in openOnLocation method. diff -r 5ff3b2f5fb1c -r 3245bb4d600b flys-client/ChangeLog --- a/flys-client/ChangeLog Tue Oct 16 12:42:52 2012 +0200 +++ b/flys-client/ChangeLog Tue Oct 16 13:06:46 2012 +0200 @@ -1,3 +1,8 @@ +2012-10-16 Björn Ricks + + * src/main/java/de/intevation/flys/client/client/ui/GaugeTree.java: + Avoid possible NullPointerException in openOnLocation method. + 2012-10-16 Felix Wolfsteller * src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java: diff -r 5ff3b2f5fb1c -r 3245bb4d600b flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTree.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTree.java Tue Oct 16 12:42:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTree.java Tue Oct 16 13:06:46 2012 +0200 @@ -291,6 +291,9 @@ } } + /** + * Open Gauge entry if a location fits to the gauge + */ public void openOnLocations(List locations) { GWT.log("GaugeTree - openOnLocations " + locations + " " + tree.getItemCount()); @@ -308,11 +311,18 @@ if (locations == null) { continue; } - if (location >= gitem.getStart() && - location <= gitem.getEnd()) { + + Double start = gitem.getStart(); + Double end = gitem.getEnd(); + if (start == null || end == null) { + // should not occur but avoid NullPointerException + continue; + } + + if (location >= start && location <= end) { isset = true; break; - } + } } item.setState(isset); }