From 48ec813c4409dea76183e86f09296d4bf62600d9 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 13 Mar 2012 20:42:36 +0200 Subject: [PATCH] Added sanity checks so communication error responses from the server do not cause extra errors --- .../terminal/gwt/client/ApplicationConnection.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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++) { -- 2.39.5