Resolve NPE that can occur if there is no SourceComponent in a Tuple

Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/4d2804aa
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/4d2804aa
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/4d2804aa

Branch: refs/heads/master
Commit: 4d2804aacb0a0abb60b5760a2f8bb3eb657ab67b
Parents: 401ebeb
Author: Niels Basjes <[email protected]>
Authored: Thu Dec 11 12:35:01 2014 +0100
Committer: Niels Basjes <[email protected]>
Committed: Thu Dec 11 12:35:01 2014 +0100

----------------------------------------------------------------------
 storm-core/src/jvm/backtype/storm/tuple/TupleImpl.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/4d2804aa/storm-core/src/jvm/backtype/storm/tuple/TupleImpl.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/tuple/TupleImpl.java 
b/storm-core/src/jvm/backtype/storm/tuple/TupleImpl.java
index 7ff2c8c..40ad11c 100644
--- a/storm-core/src/jvm/backtype/storm/tuple/TupleImpl.java
+++ b/storm-core/src/jvm/backtype/storm/tuple/TupleImpl.java
@@ -215,8 +215,8 @@ public class TupleImpl extends IndifferentAccessMap 
implements Seqable, Indexed,
     }
 
     public boolean isTick() {
-        return this.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID) 
&&
-               
this.getSourceStreamId().equals(Constants.SYSTEM_TICK_STREAM_ID);
+        return Constants.SYSTEM_COMPONENT_ID.equals(this.getSourceComponent()) 
&&
+               
Constants.SYSTEM_TICK_STREAM_ID.equals(this.getSourceStreamId());
     }
 
     public MessageId getMessageId() {

Reply via email to