mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2025-02-18 02:02:29 +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[] oi1 = oldList.get(0);
|
||||||
ItemStack[] oldInventory = Util.getContainerState(oi1);
|
ItemStack[] oldInventory = Util.getContainerState(oi1);
|
||||||
ItemStack[] newInventory = Util.getContainerState(contents);
|
ItemStack[] newInventory = Util.getContainerState(contents);
|
||||||
|
if (oldInventory == null || newInventory == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
List<ItemStack[]> forceList = ConfigHandler.forceContainer.get(loggingContainerId);
|
List<ItemStack[]> forceList = ConfigHandler.forceContainer.get(loggingContainerId);
|
||||||
if (forceList != null) {
|
if (forceList != null) {
|
||||||
|
@ -610,7 +610,10 @@ public class Util extends Queue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack[] getContainerState(ItemStack[] array) {
|
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;
|
int count = 0;
|
||||||
for (ItemStack itemStack : array) {
|
for (ItemStack itemStack : array) {
|
||||||
|
Loading…
Reference in New Issue
Block a user