summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-09-18 10:49:37 +0300
committerArtur Signell <artur@vaadin.com>2012-09-18 12:43:26 +0300
commita4759263699274d88a4f5744cd49f27028087ccd (patch)
tree420441a67ac08adbb5f32f77d54a508347dd5af4 /client
parentfb50d90d5bb213516c56264c9cb484e774e7c29b (diff)
downloadvaadin-framework-a4759263699274d88a4f5744cd49f27028087ccd.tar.gz
vaadin-framework-a4759263699274d88a4f5744cd49f27028087ccd.zip
Added null checks for callbacks in BundleLoader (#9648)
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/metadata/AsyncBundleLoader.java6
-rw-r--r--client/src/com/vaadin/client/metadata/ConnectorBundleLoader.java8
2 files changed, 10 insertions, 4 deletions
diff --git a/client/src/com/vaadin/client/metadata/AsyncBundleLoader.java b/client/src/com/vaadin/client/metadata/AsyncBundleLoader.java
index 7bbd93c6e3..2073ab7aab 100644
--- a/client/src/com/vaadin/client/metadata/AsyncBundleLoader.java
+++ b/client/src/com/vaadin/client/metadata/AsyncBundleLoader.java
@@ -53,13 +53,15 @@ public abstract class AsyncBundleLoader {
public void load(BundleLoadCallback callback, TypeDataStore store) {
assert state == State.NOT_STARTED;
state = State.LOADING;
- callbacks.add(callback);
+ addCallback(callback);
load(store);
}
public void addCallback(BundleLoadCallback callback) {
assert state == State.LOADING;
- callbacks.add(callback);
+ if (callback != null) {
+ callbacks.add(callback);
+ }
}
public List<BundleLoadCallback> setLoaded() {
diff --git a/client/src/com/vaadin/client/metadata/ConnectorBundleLoader.java b/client/src/com/vaadin/client/metadata/ConnectorBundleLoader.java
index 7d6c209ebf..0549547e38 100644
--- a/client/src/com/vaadin/client/metadata/ConnectorBundleLoader.java
+++ b/client/src/com/vaadin/client/metadata/ConnectorBundleLoader.java
@@ -47,10 +47,14 @@ public abstract class ConnectorBundleLoader {
loader.addCallback(callback);
break;
case LOADED:
- callback.loaded();
+ if (callback != null) {
+ callback.loaded();
+ }
break;
case ERROR:
- callback.failed(loader.getError());
+ if (callback != null) {
+ callback.failed(loader.getError());
+ }
}
}