Skip to content

Commit 866dade

Browse files
committed
Allow for null arguments when comparing ShowArgs
GitOrigin-RevId: 56f67d9f945253ba57abfc15288d0bda5f047f4a
1 parent 9080069 commit 866dade

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/us/mcparks/showscript/showscript/framework/ShowArgs.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,15 @@ public boolean equals(Object obj) {
6565
return false;
6666
}
6767
for (int i = 0; i < args.length; i++) {
68-
if (!args[i].equals(other.args[i])) {
68+
if (args[i] == null) {
69+
if (other.args[i] != null) {
70+
return false;
71+
}
72+
} else if (other.args[i] == null) {
73+
if (args[i] != null) {
74+
return false;
75+
}
76+
} else if (!args[i].equals(other.args[i])) {
6977
return false;
7078
}
7179
}

0 commit comments

Comments
 (0)