changeset 38:050331208ad7 CellTable

Fix for NullPointer exceptions of parameters
author Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
date Thu, 06 Dec 2012 18:04:25 +0100
parents 7c9aa2fdfa43
children ba7d401c2750
files src/econnect/wp3_3/client/core/ApplicationGrid.java
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/econnect/wp3_3/client/core/ApplicationGrid.java	Wed Dec 05 12:25:20 2012 +0100
+++ b/src/econnect/wp3_3/client/core/ApplicationGrid.java	Thu Dec 06 18:04:25 2012 +0100
@@ -593,32 +593,32 @@
 		int zoom = 0;
 		float cLon = 0, cLat = 0;
 		int mapId = 0;
-		if( !Window.Location.getParameter("zoom").equals("undefined") ){
+		if( (Window.Location.getParameter("zoom") != null) && !Window.Location.getParameter("zoom").equals("undefined") ){
 			zoom = new Integer(Window.Location.getParameter("zoom")).intValue();
 		}
-		if( !Window.Location.getParameter("centerLon").equals("undefined") ){
+		if( (Window.Location.getParameter("centerLon") != null) && !Window.Location.getParameter("centerLon").equals("undefined") ){
 			cLon = new Float(Window.Location.getParameter("centerLon")).floatValue();
 		}
-		if( !Window.Location.getParameter("centerLat").equals("undefined") ){
+		if( (Window.Location.getParameter("centerLat") != null) && !Window.Location.getParameter("centerLat").equals("undefined") ){
 			cLat = new Float(Window.Location.getParameter("centerLat")).floatValue();
 		}
-		if( !Window.Location.getParameter("mapId").equals("undefined") ){
+		if( (Window.Location.getParameter("mapId") != null) && !Window.Location.getParameter("mapId").equals("undefined") ){
 			mapId = new Integer(Window.Location.getParameter("mapId")).intValue();
 		}
 		if( zoom != 0 || cLon != 0 || cLat != 0 || mapId != 0 ){
 			this.getMap().getJsMap().configure(zoom, cLon, cLat, mapId);
 		}
 		String minSelTime = null, maxSelTime = null;
-		if( !Window.Location.getParameter("minSelTime").equals("undefined") ){
+		if( (Window.Location.getParameter("minSelTime") != null) && !Window.Location.getParameter("minSelTime").equals("undefined") ){
 			minSelTime = Window.Location.getParameter("minSelTime");
 		}
-		if( !Window.Location.getParameter("maxSelTime").equals("undefined") ){
+		if( (Window.Location.getParameter("maxSelTime") != null) && !Window.Location.getParameter("maxSelTime").equals("undefined") ){
 			maxSelTime = Window.Location.getParameter("maxSelTime");
 		}
 		if( minSelTime != null && maxSelTime != null ){
 			this.getPlot().getJsTimeplot().selectTimerange(minSelTime,maxSelTime);
 		}
-		if( !Window.Location.getParameter("connections").equals("undefined") ){
+		if( (Window.Location.getParameter("connections") != null) && !Window.Location.getParameter("connections").equals("undefined") ){
 			int connections = new Integer(Window.Location.getParameter("connections")).intValue();
 			if( connections == 1 ){
 				this.getMap().getJsMap().setConnections(connections);
@@ -626,10 +626,10 @@
 			}
 		}
 		String minTime = null, maxTime = null;
-		if( !Window.Location.getParameter("minTime").equals("undefined") ){
+		if( (Window.Location.getParameter("minTime") != null) && !Window.Location.getParameter("minTime").equals("undefined") ){
 			minTime = Window.Location.getParameter("minTime");
 		}
-		if( !Window.Location.getParameter("maxTime").equals("undefined") ){
+		if( (Window.Location.getParameter("maxTime") != null) && !Window.Location.getParameter("maxTime").equals("undefined") ){
 			maxTime = Window.Location.getParameter("maxTime");
 		}
 		if( minTime != null && maxTime != null ){