jrossignol / ContractConfigurator

A config file based solution for creating new contracts for Kerbal Space Program.
https://forum.kerbalspaceprogram.com/index.php?/topic/91625-1
Other
64 stars 67 forks source link

Error with RemoteTech contracts #705

Open Bmandk opened 3 years ago

Bmandk commented 3 years ago

I'm getting an error just when going into mission control:

NullReferenceException: Object reference not set to an instance of an object
  at ContractConfigurator.ContractRequirement.get_targetBody () [0x00010] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.ContractRequirement.ValidateTargetBody () [0x00000] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.RemoteTech.CelestialBodyCoverageRequirement.RequirementMet (ContractConfigurator.ConfiguredContract contract) [0x00013] in <c2ace121cab5435a8a1318f080da8a58>:0 
  at ContractConfigurator.ContractRequirement.CheckRequirement (ContractConfigurator.ConfiguredContract contract) [0x00000] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.AllRequirement.RequirementMet (ContractConfigurator.ConfiguredContract contract) [0x00020] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.ContractRequirement.CheckRequirement (ContractConfigurator.ConfiguredContract contract) [0x00000] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.AnyRequirement.RequirementMet (ContractConfigurator.ConfiguredContract contract) [0x00020] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.ContractRequirement.CheckRequirement (ContractConfigurator.ConfiguredContract contract) [0x00000] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.ContractRequirement.RequirementsMet (ContractConfigurator.ConfiguredContract contract, ContractConfigurator.ContractType contractType, System.Collections.Generic.IEnumerable`1[T] contractRequirements) [0x00031] in <ef0243a06f2841fe9bf57034a334902e>:0 
Rethrow as Exception: ContractConfigurator: Exception checking requirements!

UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
ContractConfigurator.LoggingUtil:LogException(Exception)
ContractConfigurator.ContractRequirement:RequirementsMet(ConfiguredContract, ContractType, IEnumerable`1)
ContractConfigurator.ContractType:MeetExtendedRequirements(ConfiguredContract, ContractType)
ContractConfigurator.ContractType:MeetRequirements(ConfiguredContract, ContractType)
ContractConfigurator.ConfiguredContract:MeetRequirements()
Contracts.Contract:Update()
ContractConfigurator.ContractPreLoader:Update()

(Filename: <ef0243a06f2841fe9bf57034a334902e> Line: 0)

From my quick browsing through the files, it seems that it is contractType in ContractRequirement that could be null, but we're still trying to access it in this getter:

        protected CelestialBody targetBody
        {
            get { return _targetBody ?? contractType.targetBody; }
        }

Although I'm not 100% sure this is the case though.