mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-22 18:46:39 +01:00
Update Utils.java
Avoid null-pointer issue if given item-list contains null elements. The issue is still that list contains these elements.
This commit is contained in:
parent
a50d00b2e7
commit
dea71358ae
@ -29,7 +29,7 @@ public class Utils
|
||||
// items are in players inventory.
|
||||
for (ItemStack item : requiredItems)
|
||||
{
|
||||
boolean isUnique = true;
|
||||
boolean isUnique = item != null;
|
||||
|
||||
int i = 0;
|
||||
final int requiredSize = returnItems.size();
|
||||
@ -49,7 +49,7 @@ public class Utils
|
||||
i++;
|
||||
}
|
||||
|
||||
if (isUnique)
|
||||
if (isUnique && item != null)
|
||||
{
|
||||
// The same issue as in other places. Clone prevents from changing original item.
|
||||
returnItems.add(item.clone());
|
||||
|
Loading…
Reference in New Issue
Block a user