diff --git a/src/org/jetbrains/eval4j/values.kt b/src/org/jetbrains/eval4j/values.kt index 40acc520c37..db6617d286c 100644 --- a/src/org/jetbrains/eval4j/values.kt +++ b/src/org/jetbrains/eval4j/values.kt @@ -97,4 +97,11 @@ val Value.obj: Any? return v } return (this as AbstractValue<*>).value - } \ No newline at end of file + } + +fun Any?.checkNull(): Any { + if (this == null) { + throw ThrownFromEvalException(ObjectValue(NullPointerException(), Type.getType(javaClass()))) + } + return this +} \ No newline at end of file diff --git a/test/org/jetbrains/eval4j/test/main.kt b/test/org/jetbrains/eval4j/test/main.kt index 38d343a6fa0..65b4f0b3b62 100644 --- a/test/org/jetbrains/eval4j/test/main.kt +++ b/test/org/jetbrains/eval4j/test/main.kt @@ -225,13 +225,6 @@ object REFLECTION_EVAL : Eval { } } - fun Any?.checkNull(): Any { - if (this == null) { - throw ThrownFromEvalException(ObjectValue(NullPointerException(), Type.getType(javaClass()))) - } - return this - } - override fun getStaticField(fieldDesc: FieldDescription): Value { val field = findStaticField(fieldDesc)