brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [2/3] brooklyn-server git commit: Task serializer: avoid NPE if task result is null
Date Fri, 01 Apr 2016 11:20:17 GMT
Task serializer: avoid NPE if task result is null

Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/2dadb24b
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/2dadb24b
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/2dadb24b

Branch: refs/heads/master
Commit: 2dadb24b9b8e458d4dc1ebe4429d070913036679
Parents: f0b1bf8
Author: Aled Sage <aled.sage@gmail.com>
Authored: Thu Mar 31 20:51:26 2016 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Thu Mar 31 20:51:26 2016 +0100

----------------------------------------------------------------------
 .../apache/brooklyn/core/mgmt/persist/XmlMementoSerializer.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/2dadb24b/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/XmlMementoSerializer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/XmlMementoSerializer.java
b/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/XmlMementoSerializer.java
index 00693d9..e9085dc 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/XmlMementoSerializer.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/XmlMementoSerializer.java
@@ -315,7 +315,10 @@ public class XmlMementoSerializer<T> extends XmlSerializer<T>
implements Memento
             if (source == null) return;
             if (((Task<?>)source).isDone() && !((Task<?>)source).isError())
{
                 try {
-                    context.convertAnother(((Task<?>)source).get());
+                    Object nextItem = ((Task<?>)source).get();
+                    if (nextItem != null) {
+                        context.convertAnother(nextItem);
+                    }
                 } catch (InterruptedException e) {
                     throw Exceptions.propagate(e);
                 } catch (ExecutionException e) {


Mime
View raw message