# By Xander Victory
# Via GitHub (1) and Xander Victory (1)
* '1.11' of https://github.com/aidancbrady/Mekanism:
  more !isEmpty checks to validate ItemStacks
  more !isEmpty checks to validate ItemStacks
  add @Nullable to internal ItemStack fields and also make sure they're not IS.isEmpty()
  Fix some more null ItemStacks found with Idea
This commit is contained in:
aidancbrady committed 2017-06-15 19:42:27 -07:00
commit 398f0284a8
25 files changed
+71 -61

No files matched your search

@@ -220,7 +220,7 @@ abstract class BasicEnergyTile implements ILocatable, IEnergyTile {
* @return true if energy was transferred
*/
public boolean charge(ItemStack stack) {
if (stack == null || !Info.isIc2Available() || getWorldObj().isRemote) return false;
if (stack == null || stack.isEmpty() || !Info.isIc2Available() || getWorldObj().isRemote) return false;
double amount = ElectricItem.manager.charge(stack, energyStored, Math.max(getSinkTier(), getSourceTier()), false, false);
@@ -237,7 +237,7 @@ abstract class BasicEnergyTile implements ILocatable, IEnergyTile {
* @return true if energy was transferred
*/
public boolean discharge(ItemStack stack, double limit) {
if (stack == null || !Info.isIc2Available() || getWorldObj().isRemote) return false;
if (stack == null || stack.isEmpty() || !Info.isIc2Available() || getWorldObj().isRemote) return false;
double amount = capacity - energyStored;
if (amount <= 0) return false;