thomasfn / EcoLawExtensionsMod

MIT License
7 stars 2 forks source link

Possible server crash when using law clauses affecting power grids #33

Open AWL-Gaming opened 8 months ago

AWL-Gaming commented 8 months ago
[15:47:37.829] [12] [Error] [Eco] System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Eco.Gameplay.Civics.Laws.LegalActions.Money.TaxPayBase_LegalAction.GovernmentTransferUsers(LocString description, Single amount, Currency currency, BankAccount governmentAccount, GameValue`1 aliasGameValue, IContextObject context, Settlement jurisdictionSettlement, Boolean canTransferNonCitizens, Boolean taxing, Boolean preventIfUnableToPay, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.LegalActions.Money.Pay_LegalAction.DoTransfer(LocString description, IContextObject context, Settlement jurisdictionSettlement, Single amount, Currency currency, Boolean preventIfUnableToPay, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.LegalActions.Money.MoneyTransferBase_LegalAction.Do(LocString description, IContextObject context, Settlement jurisdictionSettlement, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.LegalActions.Money.MoneyTransferBase_LegalAction.Perform(Law law, GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.Civics.LegalAction.PerformAndProcessResult(Law law, GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.Civics.IfThenBlock.TryPerform(Law law, GameAction action, AccountChangeSet acc, LawSection section, Int32 index, LocStringBuilder sbDebug)
   at Eco.Gameplay.Civics.Laws.LawSection.CheckConditionsAndApplyEffects(Law law, GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.LawSection.InternalPerform(Law law, GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.LawSection.Perform(Law law, GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.Law.TryPerform(GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.LawManager.Perform(GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.GameActions.GameActionManager.TryPerformActions(PackFlags flags, List`1 actions, IEnumerable`1 preTests, IEnumerable`1 postEffects, AccountChangeSet acc)
   at Eco.Gameplay.GameActions.GameActionManager.TryPerformActions(User userToNotify, GameActionPack actionPack)
   at Eco.Mods.LawExtensions.PowerGridLawManager.DoLawTick(Single deltaTime)
   at Eco.Core.Utils.Threading.PeriodicWorkerFactory.<>c__DisplayClass0_0.<Create>b__0(CancellationToken token)
   at Eco.Core.Utils.Threading.RepeatableWorkerBase.DoWork(CancellationToken token)
   --- End of inner exception stack trace --- System.NullReferenceException: Object reference not set to an instance of an object.
   at Eco.Gameplay.Civics.Laws.LegalActions.Money.TaxPayBase_LegalAction.GovernmentTransferUsers(LocString description, Single amount, Currency currency, BankAccount governmentAccount, GameValue`1 aliasGameValue, IContextObject context, Settlement jurisdictionSettlement, Boolean canTransferNonCitizens, Boolean taxing, Boolean preventIfUnableToPay, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.LegalActions.Money.Pay_LegalAction.DoTransfer(LocString description, IContextObject context, Settlement jurisdictionSettlement, Single amount, Currency currency, Boolean preventIfUnableToPay, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.LegalActions.Money.MoneyTransferBase_LegalAction.Do(LocString description, IContextObject context, Settlement jurisdictionSettlement, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.LegalActions.Money.MoneyTransferBase_LegalAction.Perform(Law law, GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.Civics.LegalAction.PerformAndProcessResult(Law law, GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.Civics.IfThenBlock.TryPerform(Law law, GameAction action, AccountChangeSet acc, LawSection section, Int32 index, LocStringBuilder sbDebug)
   at Eco.Gameplay.Civics.Laws.LawSection.CheckConditionsAndApplyEffects(Law law, GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.LawSection.InternalPerform(Law law, GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.LawSection.Perform(Law law, GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.Law.TryPerform(GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.Civics.Laws.LawManager.Perform(GameAction action, AccountChangeSet acc)
   at Eco.Gameplay.GameActions.GameActionManager.TryPerformActions(PackFlags flags, List`1 actions, IEnumerable`1 preTests, IEnumerable`1 postEffects, AccountChangeSet acc)
   at Eco.Gameplay.GameActions.GameActionManager.TryPerformActions(User userToNotify, GameActionPack actionPack)
   at Eco.Mods.LawExtensions.PowerGridLawManager.DoLawTick(Single deltaTime)
   at Eco.Core.Utils.Threading.PeriodicWorkerFactory.<>c__DisplayClass0_0.<Create>b__0(CancellationToken token)
   at Eco.Core.Utils.Threading.RepeatableWorkerBase.DoWork(CancellationToken token)