From 17c6ec1f97cdcd29091577fbc0d897bc3cbaa763 Mon Sep 17 00:00:00 2001 From: Sid Pranjale Date: Wed, 9 Nov 2022 21:19:02 +0530 Subject: [PATCH] Do nothing if a module has no experimentals This fixes materials not being shown for modules that can be engineered but not having experimental effects --- src/app/components/ModalShoppingList.jsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/components/ModalShoppingList.jsx b/src/app/components/ModalShoppingList.jsx index edf08d5c..1ff8e03f 100644 --- a/src/app/components/ModalShoppingList.jsx +++ b/src/app/components/ModalShoppingList.jsx @@ -177,14 +177,16 @@ export default class ModalShoppingList extends TranslatedComponent { mats[i] = module.m.blueprint.grades[g].components[i] * this.state.matsPerGrade[g]; } } - for (const j in module.m.blueprint.special.components) { - if (!module.m.blueprint.special.components.hasOwnProperty(j)) { - continue; - } - if (mats[j]) { - mats[j] += module.m.blueprint.special.components[j]; - } else { - mats[j] = module.m.blueprint.special.components[j]; + if (module.m.blueprint.special) { + for (const j in module.m.blueprint.special.components) { + if (!module.m.blueprint.special.components.hasOwnProperty(j)) { + continue; + } + if (mats[j]) { + mats[j] += module.m.blueprint.special.components[j]; + } else { + mats[j] = module.m.blueprint.special.components[j]; + } } } }