From 9aa8203dcc1d15b0c691ceba1a88a05eef291304 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Thu, 29 Apr 2021 11:50:16 +0200 Subject: [PATCH] Fixed bug where effects in stat computation could be undefined --- app/imports/api/creature/computation/engine/computeStat.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/imports/api/creature/computation/engine/computeStat.js b/app/imports/api/creature/computation/engine/computeStat.js index abce5e59..0b31f555 100644 --- a/app/imports/api/creature/computation/engine/computeStat.js +++ b/app/imports/api/creature/computation/engine/computeStat.js @@ -21,7 +21,7 @@ export default function computeStat(stat, memo){ // Before doing any work, mark this stat as busy stat.computationDetails.busyComputing = true; - let effects = stat.computationDetails.effects; + let effects = stat.computationDetails.effects || []; let proficiencies = stat.computationDetails.proficiencies; // Get references to all the stats that share the variable name @@ -126,7 +126,6 @@ export default function computeStat(stat, memo){ // Compute and aggregate all the effects let aggregator = new EffectAggregator(); let effectDeps = []; - if (Meteor.isClient) console.log({effects}); each(effects, (effect) => { // Compute computeEffect(effect, memo);