Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java @ 1578:df11c4c8c578
Avoid certain npes.
flys-client/trunk@3847 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 01 Feb 2012 08:51:30 +0000 |
parents | 465f72f68cee |
children | e0d665661a1d |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java Tue Jan 31 15:42:02 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java Wed Feb 01 08:51:30 2012 +0000 @@ -116,7 +116,13 @@ /** Access data of collection item of theme. */ public static String dataOf(Theme theme, String dataItemName) { - return theme.getCollectionItem().getData().get(dataItemName); + if (theme != null && theme.getCollectionItem() != null + && theme.getCollectionItem().getData() != null + ) { + return theme.getCollectionItem().getData().get(dataItemName); + } + + return null; } @@ -679,11 +685,15 @@ for (int i = 1; i <= count; i++) { Theme theme = themeList.getThemeAt(i); - if(theme.getFacet().equals("empty.facet")) { + if (theme == null) { + continue; + } + + if (theme.getFacet().equals("empty.facet")) { theme.setVisible(0); } - if (theme == null || theme.getVisible() == 0) { + if (theme.getVisible() == 0) { continue; }