From: Artur Signell Date: Tue, 13 Mar 2012 18:42:36 +0000 (+0200) Subject: Added sanity checks so communication error responses from the X-Git-Tag: 7.0.0.alpha2~332 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=48ec813c4409dea76183e86f09296d4bf62600d9;p=vaadin-framework.git Added sanity checks so communication error responses from the server do not cause extra errors --- diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index a6ef93854e..a7362cbb8c 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -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 events = new LinkedList(); 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++) {