From 832f5c1c9b73c42cd898c87a442a623af04ca5a8 Mon Sep 17 00:00:00 2001 From: cuqmbr Date: Sat, 4 Dec 2021 20:41:50 +0200 Subject: [PATCH] undefined values stop calculation of the formula --- Boolean-Algebra/script.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Boolean-Algebra/script.js b/Boolean-Algebra/script.js index 1af22fb..969379c 100644 --- a/Boolean-Algebra/script.js +++ b/Boolean-Algebra/script.js @@ -66,6 +66,7 @@ function Evaluate() { let formulaValuesRPNArray = ConvertCharsToValues(formulaRPNArray); let result = SolveRPNFormula(formulaValuesRPNArray); + if (result == undefined) return; let readableResult = ConvertToReadableResult(result); let resultField = document.getElementById('result'); @@ -272,6 +273,7 @@ function StepByStep() { let formulaValuesRPNArray = ConvertCharsToValues(formulaRPNArray); let result = SolveRPNFormula(formulaValuesRPNArray); + if (result == undefined) return; let readableResult = ConvertToReadableResult(result); let resultField = document.getElementById('result');