From 3ebfe045c54e756158203e8bf1a5da2b5c610cdc Mon Sep 17 00:00:00 2001 From: blitzmann Date: Tue, 12 Jun 2018 21:15:31 -0400 Subject: [PATCH] Catch a rare error with mutators that are kinda orphaned (not via module, but the mod doesn't have base or mutaplasmid) --- eos/saveddata/mutator.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/eos/saveddata/mutator.py b/eos/saveddata/mutator.py index 19b13ae22..84e3ddbc4 100644 --- a/eos/saveddata/mutator.py +++ b/eos/saveddata/mutator.py @@ -66,10 +66,15 @@ class Mutator(EqBase): self.value = self.value # run the validator (to ensure we catch any changed min/max values might CCP release) def build(self): - # dynamic attribute links to the Mutaplasmids attribute definition for this mutated definition - self.dynamicAttribute = next(a for a in self.module.mutaplasmid.attributes if a.attributeID == self.attrID) - # base attribute links to the base ite's attribute for this mutated definition (contains original, base value) - self.baseAttribute = self.module.item.attributes[self.dynamicAttribute.name] + # try...except here to catch orphaned mutators. Pretty rare, only happens so far if hacking the database + # But put it here to remove the module link if it happens, until a better solution can be developed + try: + # dynamic attribute links to the Mutaplasmids attribute definition for this mutated definition + self.dynamicAttribute = next(a for a in self.module.mutaplasmid.attributes if a.attributeID == self.attrID) + # base attribute links to the base ite's attribute for this mutated definition (contains original, base value) + self.baseAttribute = self.module.item.attributes[self.dynamicAttribute.name] + except: + self.module = None @validates("value") def validator(self, key, val):