package cpup.lib

object Util {
	def checkNull[R](obj: R, default: R): R = {
		if(obj == null) {
			default
		} else {
			obj
		}
	}
}
package cpup.lib

object Util {
	def checkNull[T, R](obj: T, fn: (T) => R, default: R): R = {
		if(obj == null) {
			default
		} else {
			fn(obj)
		}
	}
}
--- 
+++ 
@@ -1,11 +1,11 @@
 package cpup.lib
 
 object Util {
-	def checkNull[T, R](obj: T, fn: (T) => R, default: R): R = {
+	def checkNull[R](obj: R, default: R): R = {
 		if(obj == null) {
 			default
 		} else {
-			fn(obj)
+			obj
 		}
 	}
 }
Make checkNull just check for null and return a default
