mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-12-28 17:47:41 +01:00
Fixed NullPointerException while logging container transactions
This commit is contained in:
parent
4cce566e37
commit
9e1d5af97d
@ -57,6 +57,9 @@ public class ContainerLogger extends Queue {
|
||||
ItemStack[] oi1 = oldList.get(0);
|
||||
ItemStack[] oldInventory = Util.getContainerState(oi1);
|
||||
ItemStack[] newInventory = Util.getContainerState(contents);
|
||||
if (oldInventory == null || newInventory == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<ItemStack[]> forceList = ConfigHandler.forceContainer.get(loggingContainerId);
|
||||
if (forceList != null) {
|
||||
|
@ -610,7 +610,10 @@ public class Util extends Queue {
|
||||
}
|
||||
|
||||
public static ItemStack[] getContainerState(ItemStack[] array) {
|
||||
ItemStack[] result = array.clone();
|
||||
ItemStack[] result = array == null ? null : array.clone();
|
||||
if (result == null) {
|
||||
return result;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
for (ItemStack itemStack : array) {
|
||||
|
Loading…
Reference in New Issue
Block a user