diff options
author | Artur Signell <artur@vaadin.com> | 2012-09-18 10:49:37 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-09-18 12:43:26 +0300 |
commit | a4759263699274d88a4f5744cd49f27028087ccd (patch) | |
tree | 420441a67ac08adbb5f32f77d54a508347dd5af4 /client | |
parent | fb50d90d5bb213516c56264c9cb484e774e7c29b (diff) | |
download | vaadin-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.java | 6 | ||||
-rw-r--r-- | client/src/com/vaadin/client/metadata/ConnectorBundleLoader.java | 8 |
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()); + } } } |