fix NPE when configuring storage busses

This commit is contained in:
PrototypeTrousers
2021-08-01 17:36:23 -03:00
parent cbdad7c58e
commit 09cbfe96d6
2 changed files with 14 additions and 10 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ aechannel=stable
aebuild=7
aegroup=appeng
aebasename=appliedenergistics2
trousers=omni-fixes-v45l
trousers=omni-fixes-v45m
#########################################################
# Versions #
@@ -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;