From b0e9ba4d1c15925f59c63ad75b8c88d0d55039e1 Mon Sep 17 00:00:00 2001 From: irismarie Date: Tue, 16 Feb 2021 19:41:32 +0100 Subject: [PATCH] bugfix: configSnapshots empty or null --- src/scenario/scenario.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/scenario/scenario.js b/src/scenario/scenario.js index 15ab264..65799ff 100644 --- a/src/scenario/scenario.js +++ b/src/scenario/scenario.js @@ -700,11 +700,19 @@ class Scenario extends React.Component { } openResultConfigSnaphots(result) { - this.setState({ - modalResultConfigs: JSON.parse(result.configSnapshots), - modalResultConfigsIndex: result.id, - resultConfigsModal: true - }); + if (!result.configSnapshots || result.configSnapshots == "") { + this.setState({ + modalResultConfigs: {"configs": []}, + modalResultConfigsIndex: result.id, + resultConfigsModal: true + }); + } else { + this.setState({ + modalResultConfigs: JSON.parse(result.configSnapshots), + modalResultConfigsIndex: result.id, + resultConfigsModal: true + }); + } } closeResultConfigSnapshots() {