]> source.dussan.org Git - vaadin-framework.git/commitdiff
Added sanity checks so communication error responses from the
authorArtur Signell <artur@vaadin.com>
Tue, 13 Mar 2012 18:42:36 +0000 (20:42 +0200)
committerArtur Signell <artur@vaadin.com>
Wed, 14 Mar 2012 14:01:00 +0000 (16:01 +0200)
server do not cause extra errors

src/com/vaadin/terminal/gwt/client/ApplicationConnection.java

index a6ef93854ee9e82389d82b5fe4c73b0b47fe7218..a7362cbb8c0064ae2861b56df9bd51c655d65b35 100644 (file)
@@ -1117,6 +1117,10 @@ public class ApplicationConnection {
             private void createConnectorsIfNeeded(ValueMap json) {
                 VConsole.log(" * Creating connectors (if needed)");
 
+                if (!json.containsKey("types")) {
+                    return;
+                }
+
                 ValueMap types = json.getValueMap("types");
                 JsArrayString keyArray = types.getKeyArray();
                 for (int i = 0; i < keyArray.length(); i++) {
@@ -1193,6 +1197,9 @@ public class ApplicationConnection {
 
             private void updateConnectorState(ValueMap json) {
                 VConsole.log(" * Updating connector states");
+                if (!json.containsKey("state")) {
+                    return;
+                }
                 // set states for all paintables mentioned in "state"
                 ValueMap states = json.getValueMap("state");
                 JsArrayString keyArray = states.getKeyArray();
@@ -1233,6 +1240,10 @@ public class ApplicationConnection {
                 List<ConnectorHierarchyChangedEvent> events = new LinkedList<ConnectorHierarchyChangedEvent>();
 
                 VConsole.log(" * Updating connector hierarchy");
+                if (!json.containsKey("hierarchy")) {
+                    return events;
+                }
+
                 ValueMap hierarchies = json.getValueMap("hierarchy");
                 JsArrayString hierarchyKeys = hierarchies.getKeyArray();
                 for (int i = 0; i < hierarchyKeys.length(); i++) {