From aa6d05af2e9d8ef5fbe1247cd6236ebaa8b07abb Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sat, 24 May 2014 18:23:40 -0500 Subject: [PATCH] Fixed a potential crash when picking up items. --- container/AEBaseContainer.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/container/AEBaseContainer.java b/container/AEBaseContainer.java index ec595a52e..59c65e8d8 100644 --- a/container/AEBaseContainer.java +++ b/container/AEBaseContainer.java @@ -809,9 +809,14 @@ public abstract class AEBaseContainer extends Container long maxSize = ais.getItemStack().getMaxStackSize(); ais.setStackSize( maxSize ); ais = cellInv.extractItems( ais, Actionable.SIMULATE, mySrc ); - long stackSize = Math.min( maxSize, ais.getStackSize() ); - ais.setStackSize( (stackSize + 1) >> 1 ); - ais = Platform.poweredExtraction( powerSrc, cellInv, ais, mySrc ); + + if ( ais != null ) + { + long stackSize = Math.min( maxSize, ais.getStackSize() ); + ais.setStackSize( (stackSize + 1) >> 1 ); + ais = Platform.poweredExtraction( powerSrc, cellInv, ais, mySrc ); + } + if ( ais != null ) player.inventory.setItemStack( ais.getItemStack() ); else