sarbian/ModuleManager

Exceptions when pasting nodes

blowfishpro opened this issue · 1 comments

[LOG 2019-05-12 21:38:47.614] Applying update KerbalAtomicsLH2NTRModSupport/hydrogenNTRsMissingHistory/@PART[nuclearEngine_size0]:NEEDS[MissingHistory]:BEFORE[zzLH2NTR] to MissingHistory/PorkjetParts/AtomicAge/KANDL/KANDL.cfg/PART
[EXC 2019-05-12 21:38:47.614] System.NullReferenceException: Object reference not set to an instance of an object
  at ModuleManager.MMPatchLoader.FindConfigNodeIn (.ConfigNode src, System.String nodeType, System.String nodeName, Int32 index) [0x00000] in <filename unknown>:0 
  at ModuleManager.MMPatchLoader.RecurseNodeSearch (System.String path, ModuleManager.Collections.ImmutableStack`1 nodeStack, PatchContext context) [0x00000] in <filename unknown>:0 
  at ModuleManager.MMPatchLoader.RecurseNodeSearch (System.String path, ModuleManager.Collections.ImmutableStack`1 nodeStack, PatchContext context) [0x00000] in <filename unknown>:0 
  at ModuleManager.MMPatchLoader.RecurseNodeSearch (System.String path, ModuleManager.Collections.ImmutableStack`1 nodeStack, PatchContext context) [0x00000] in <filename unknown>:0 
  at ModuleManager.MMPatchLoader.ModifyNode (ModuleManager.Collections.ImmutableStack`1 original, .ConfigNode mod, PatchContext context) [0x00000] in <filename unknown>:0 
  at ModuleManager.MMPatchLoader.ModifyNode (ModuleManager.Collections.ImmutableStack`1 original, .ConfigNode mod, PatchContext context) [0x00000] in <filename unknown>:0 
  at ModuleManager.MMPatchLoader.ModifyNode (ModuleManager.Collections.ImmutableStack`1 original, .ConfigNode mod, PatchContext context) [0x00000] in <filename unknown>:0 
  at ModuleManager.Patches.EditPatch.Apply (System.Collections.Generic.LinkedList`1 databaseConfigs, IPatchProgress progress, IBasicLogger logger) [0x00000] in <filename unknown>:0 
[LOG 2019-05-12 21:38:47.614] Applying update KerbalAtomicsLH2NTRModSupport/hydrogenNTRsMissingHistory/@PART[nuclearEngine_1p5]:NEEDS[MissingHistory]:BEFORE[zzLH2NTR] to MissingHistory/PorkjetParts/AtomicAge/BKN/BKN.cfg/PART
[EXC 2019-05-12 21:38:47.614] System.NullReferenceException: Object reference not set to an instance of an object
  at ModuleManager.MMPatchLoader.FindConfigNodeIn (.ConfigNode src, System.String nodeType, System.String nodeName, Int32 index) [0x00000] in <filename unknown>:0 
  at ModuleManager.MMPatchLoader.RecurseNodeSearch (System.String path, ModuleManager.Collections.ImmutableStack`1 nodeStack, PatchContext context) [0x00000] in <filename unknown>:0 
  at ModuleManager.MMPatchLoader.RecurseNodeSearch (System.String path, ModuleManager.Collections.ImmutableStack`1 nodeStack, PatchContext context) [0x00000] in <filename unknown>:0 
  at ModuleManager.MMPatchLoader.RecurseNodeSearch (System.String path, ModuleManager.Collections.ImmutableStack`1 nodeStack, PatchContext context) [0x00000] in <filename unknown>:0 
  at ModuleManager.MMPatchLoader.ModifyNode (ModuleManager.Collections.ImmutableStack`1 original, .ConfigNode mod, PatchContext context) [0x00000] in <filename unknown>:0 
  at ModuleManager.MMPatchLoader.ModifyNode (ModuleManager.Collections.ImmutableStack`1 original, .ConfigNode mod, PatchContext context) [0x00000] in <filename unknown>:0 
  at ModuleManager.MMPatchLoader.ModifyNode (ModuleManager.Collections.ImmutableStack`1 original, .ConfigNode mod, PatchContext context) [0x00000] in <filename unknown>:0 
  at ModuleManager.Patches.EditPatch.Apply (System.Collections.Generic.LinkedList`1 databaseConfigs, IPatchProgress progress, IBasicLogger logger) [0x00000] in <filename unknown>:0 
[LOG 2019-05-12 21:38:47.614] Applying update KerbalAtomicsLH2NTRModSupport/hydrogenNTRsMissingHistory/@PART[nuclearEngine_1p5]:NEEDS[NearFutureElectrical&MissingHistory]:BEFORE[zzLH2NTR] to MissingHistory/PorkjetParts/AtomicAge/BKN/BKN.cfg/PART

from https://github.com/ChrisAdderley/KerbalAtomics/blob/84f94a4c475e3b46699e49b595152dd3a8c7b033/Extras/KerbalAtomicsLH2NTRModSupport/hydrogenNTRsMissingHistory.cfg

Details are in post-kerbin-mining-corporation/KerbalAtomics#74. Bottom line is that it's trying to copy from a node that doesn't exist (because another patch deleted it beforehand). On the KerbalAtomics side, the fix is to use the correct node path in the patch, but from an MM standpoint it seems like a bug that this throws an exception instead of just being reported as an erroneous patch.