# HG changeset patch # User Felix Wolfsteller # Date 1327055007 0 # Node ID 4e0878695c5f1e9dccb0c699aaa9ada1bc704aea # Parent 8c9c40459d8f179d8566f982758bdf639e9fdc35 Made StyledSeriesBuilder more robust. flys-artifacts/trunk@3741 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 8c9c40459d8f -r 4e0878695c5f flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Fri Jan 20 09:38:43 2012 +0000 +++ b/flys-artifacts/ChangeLog Fri Jan 20 10:23:27 2012 +0000 @@ -1,3 +1,8 @@ +2012-01-20 Felix Wolfsteller + + * src/main/java/de/intevation/flys/exports/StyledSeriesBuilder.java: + Added null-guards to functions parameters. + 2012-01-20 Felix Wolfsteller * src/main/java/de/intevation/flys/artifacts/model/HYKFactory.java: diff -r 8c9c40459d8f -r 4e0878695c5f flys-artifacts/src/main/java/de/intevation/flys/exports/StyledSeriesBuilder.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/StyledSeriesBuilder.java Fri Jan 20 09:38:43 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/StyledSeriesBuilder.java Fri Jan 20 10:23:27 2012 +0000 @@ -48,6 +48,10 @@ * @param points Points to add to series. */ public static void addPoints(XYSeries series, WKms wkms) { + if (wkms == null) { + return; + } + int size = wkms.size(); for (int i = 0; i < size; i++) { @@ -63,11 +67,15 @@ * @param points Points to add to series. */ public static void addPointsKmQ(XYSeries series, WQKms wqkms) { - int size = wqkms.size(); + if (wqkms == null) { + return; + } - for (int i = 0; i < size; i++) { - series.add(wqkms.getKm(i), wqkms.getQ(i), false); - } + int size = wqkms.size(); + + for (int i = 0; i < size; i++) { + series.add(wqkms.getKm(i), wqkms.getQ(i), false); + } } @@ -78,6 +86,10 @@ * @param points Points to add to series. */ public static void addPointsQW(XYSeries series, WQKms wqkms) { + if (wqkms == null) { + return; + } + int size = wqkms.size(); for (int i = 0; i < size; i++) {