You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/12/20 05:42:01 UTC

[groovy] branch master updated: Trivial tweak `isIdentical` to avoid NPE

This is an automated email from the ASF dual-hosted git repository.

sunlan 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 d74d893  Trivial tweak `isIdentical` to avoid NPE
d74d893 is described below

commit d74d893da773f9fff33b470c33b9d451d2df9d76
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Dec 20 13:41:16 2020 +0800

    Trivial tweak `isIdentical` to avoid NPE
---
 .../groovy/ginq/provider/collection/runtime/QueryableHelper.groovy       | 1 +
 1 file changed, 1 insertion(+)

diff --git a/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableHelper.groovy b/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableHelper.groovy
index 24525d4..0d09df0 100644
--- a/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableHelper.groovy
+++ b/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableHelper.groovy
@@ -80,6 +80,7 @@ class QueryableHelper {
      */
     static boolean isIdentical(Object obj1, Object obj2) {
         if (obj1 === obj2) return true
+        if (null === obj1 || null === obj2) return false
         if (obj1.getClass() !== obj2.getClass()) return false
 
         if (obj1 instanceof NamedTuple && obj2 instanceof NamedTuple) {