# HG changeset patch # User Sebastian Kruse # Date 1354813465 -3600 # Node ID 050331208ad7e17d1227678ba78c23926be30bdc # Parent 7c9aa2fdfa43bc1421c77814b4ca6c95cebe086e Fix for NullPointer exceptions of parameters diff -r 7c9aa2fdfa43 -r 050331208ad7 src/econnect/wp3_3/client/core/ApplicationGrid.java --- 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 ){