fix NPE when configuring storage busses
This commit is contained in:
@@ -369,19 +369,23 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
boolean denyRead = false;
|
||||
if( in != null )
|
||||
{
|
||||
AccessRestriction currentAccess = ( AccessRestriction ) ( ( ConfigManager ) this.getConfigManager() ).getSetting( Settings.ACCESS );
|
||||
AccessRestriction oldAccess = ( AccessRestriction ) ( ( ConfigManager ) this.getConfigManager() ).getOldSetting( Settings.ACCESS );
|
||||
if( oldAccess.hasPermission( AccessRestriction.READ ) && !currentAccess.hasPermission( AccessRestriction.READ ) )
|
||||
{
|
||||
denyRead = true;
|
||||
}
|
||||
if( accessChanged )
|
||||
{
|
||||
AccessRestriction currentAccess = (AccessRestriction) ( (ConfigManager) this.getConfigManager() ).getSetting( Settings.ACCESS );
|
||||
AccessRestriction oldAccess = (AccessRestriction) ( (ConfigManager) this.getConfigManager() ).getOldSetting( Settings.ACCESS );
|
||||
if( oldAccess.hasPermission( AccessRestriction.READ ) && !currentAccess.hasPermission( AccessRestriction.READ ) )
|
||||
{
|
||||
denyRead = true;
|
||||
}
|
||||
in.setBaseAccess( oldAccess );
|
||||
before = in.getAvailableItems( before );
|
||||
in.setBaseAccess( currentAccess );
|
||||
accessChanged = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
before = in.getAvailableItems( before );
|
||||
}
|
||||
before = in.getAvailableItems( before );
|
||||
accessChanged = false;
|
||||
in.setBaseAccess( currentAccess );
|
||||
}
|
||||
|
||||
this.cached = false;
|
||||
|
||||
Reference in New Issue
Block a user