If value is falsey then don't try to executeAst

This commit is contained in:
49lf
2024-11-13 01:11:08 -05:00
parent c1c1f817c9
commit e372b2680e

View File

@ -115,6 +115,7 @@ export function useCalculateKclExpression({
setCalcResult(typeof result === 'number' ? String(result) : 'NAN')
init && setValueNode(init)
}
if (!value) return
execAstAndSetResult().catch(() => {
setCalcResult('NAN')
setValueNode(null)