You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by Ethanlm <gi...@git.apache.org> on 2018/10/15 21:57:52 UTC

[GitHub] storm pull request #2744: [STORM-3132] Avoid NPE in the Values Constructor

Github user Ethanlm commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2744#discussion_r225330762
  
    --- Diff: storm-client/src/jvm/org/apache/storm/tuple/Values.java ---
    @@ -23,9 +23,13 @@ public Values() {
         }
     
         public Values(Object... vals) {
    -        super(vals.length);
    -        for (Object o : vals) {
    -            add(o);
    +        super(vals != null ? vals.length : 0);
    --- End diff --
    
    I think this can be `super(vals != null ? vals.length : 1);` since `if (vals==null)` we are going to add `null` to it. The length will be 1.


---