crunch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwi...@apache.org
Subject crunch git commit: CRUNCH-516: Add null checks inside of TypeMapFn
Date Wed, 29 Apr 2015 23:41:49 GMT
Repository: crunch
Updated Branches:
  refs/heads/master a3761da72 -> cc62ef73e


CRUNCH-516: Add null checks inside of TypeMapFn


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

Branch: refs/heads/master
Commit: cc62ef73edaba3905d10d501374486146be44f70
Parents: a3761da
Author: Josh Wills <jwills@apache.org>
Authored: Wed Apr 29 16:23:10 2015 -0700
Committer: Josh Wills <jwills@apache.org>
Committed: Wed Apr 29 16:23:10 2015 -0700

----------------------------------------------------------------------
 .../src/main/scala/org/apache/crunch/scrunch/PTypeFamily.scala    | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/crunch/blob/cc62ef73/crunch-scrunch/src/main/scala/org/apache/crunch/scrunch/PTypeFamily.scala
----------------------------------------------------------------------
diff --git a/crunch-scrunch/src/main/scala/org/apache/crunch/scrunch/PTypeFamily.scala b/crunch-scrunch/src/main/scala/org/apache/crunch/scrunch/PTypeFamily.scala
index 95ff25b..6a80377 100644
--- a/crunch-scrunch/src/main/scala/org/apache/crunch/scrunch/PTypeFamily.scala
+++ b/crunch-scrunch/src/main/scala/org/apache/crunch/scrunch/PTypeFamily.scala
@@ -66,6 +66,9 @@ class TypeMapFn[P <: Product](val rc: Class[_], @transient var ctor:
java.lang.r
   }
 
   override def map(x: TupleN): P = {
+    if (x == null) {
+      return null.asInstanceOf[P]
+    }
     ctor.newInstance(x.getValues : _*).asInstanceOf[P]
   }
 }


Mime
View raw message