First batch of null -> isEmpty() checks.
I most likely still missed a ton of checks...
This commit is contained in:
@@ -220,7 +220,7 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
|
||||
{
|
||||
for( final ItemStack is : options )
|
||||
{
|
||||
if( is != null && is.getItem() != null )
|
||||
if( !is.isEmpty() && is.getItem() != null )
|
||||
{
|
||||
replacement = is.copy();
|
||||
break;
|
||||
@@ -301,7 +301,7 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
|
||||
upgrades = ( (ISegmentedInventory) te ).getInventoryByName( "upgrades" );
|
||||
}
|
||||
|
||||
if( upgrades != null && player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof IUpgradeModule )
|
||||
if( upgrades != null && !player.getHeldItemMainhand().isEmpty() && player.getHeldItemMainhand().getItem() instanceof IUpgradeModule )
|
||||
{
|
||||
final IUpgradeModule um = (IUpgradeModule) player.getHeldItemMainhand().getItem();
|
||||
final Upgrades u = um.getType( player.getHeldItemMainhand() );
|
||||
@@ -362,7 +362,7 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
|
||||
|
||||
private String nameOf( final ItemStack is )
|
||||
{
|
||||
if( is == null )
|
||||
if( is.isEmpty() )
|
||||
{
|
||||
return "null";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user