Fixed NullPointerException while logging container transactions

This commit is contained in:
Intelli 2023-07-19 17:11:47 -06:00
parent 4cce566e37
commit 9e1d5af97d
2 changed files with 7 additions and 1 deletions

View File

@ -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) {

View File

@ -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) {