summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-03-13 20:42:36 +0200
committerArtur Signell <artur@vaadin.com>2012-03-14 16:01:00 +0200
commit48ec813c4409dea76183e86f09296d4bf62600d9 (patch)
tree0ba9da4bc90e942298a991387a6c680aa45da6c0 /src/com
parenta6bd5a0d408c492e525d81532fbc22a2c224af9e (diff)
downloadvaadin-framework-48ec813c4409dea76183e86f09296d4bf62600d9.tar.gz
vaadin-framework-48ec813c4409dea76183e86f09296d4bf62600d9.zip
Added sanity checks so communication error responses from the
server do not cause extra errors
Diffstat (limited to 'src/com')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ApplicationConnection.java11
1 files changed, 11 insertions, 0 deletions
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<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++) {