Proper fix null checks

Proper fix null checks
This commit is contained in:
Usernm committed 2021-09-07 03:17:27 +03:00
1 parent a3cc0fd527
commit 5b41d3f669
1 file changed
+10 -6
@@ -188,12 +188,16 @@ public class HandlerKnowledgeCore
continue;
boolean match = true;
for (int i = 0; i < newInputs.length; ++i) {
if (null == oldInputs[i] || null == newInputs[i])
continue;
if (!ItemStack.areItemStacksEqual(oldInputs[i].getItemStack(), newInputs[i].getItemStack())) {
match = false;
break;
}
if (oldInputs[i] == null && newInputs[i] == null)
continue;
if (oldInputs[i] == null || newInputs[i] == null) {
match = false;
break;
}
if (!ItemStack.areItemStacksEqual(oldInputs[i].getItemStack(), newInputs[i].getItemStack())) {
match = false;
break;
}
}
if (match) {
// can't be more than one duplicate