You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/11/20 13:02:55 UTC
[groovy] branch master updated: GROOVY-9758: groovsh import of non
existing class throws null pointer instead of syntax error (avoid NPE)
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 76954b0 GROOVY-9758: groovsh import of non existing class throws null pointer instead of syntax error (avoid NPE)
76954b0 is described below
commit 76954b063eb5a106e1b8d7e7451950965dd4511a
Author: Paul King <pa...@asert.com.au>
AuthorDate: Fri Nov 20 23:02:47 2020 +1000
GROOVY-9758: groovsh import of non existing class throws null pointer instead of syntax error (avoid NPE)
---
.../groovy/org/apache/groovy/groovysh/commands/ImportCommand.groovy | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/commands/ImportCommand.groovy b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/commands/ImportCommand.groovy
index 9dc5585..75add64 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/commands/ImportCommand.groovy
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/commands/ImportCommand.groovy
@@ -129,7 +129,9 @@ class ImportCommand extends CommandSupport {
}
finally {
// Remove the class generated while testing the import syntax
- classLoader.removeClassCacheEntry(type?.name)
+ if (type?.name) {
+ classLoader.removeClassCacheEntry(type.name)
+ }
}
}
}