diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2024-03-31 13:24:39 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2024-03-31 13:24:39 -0400 |
commit | c254b38690e27b32d3ac6316af9bb37d6d3e86aa (patch) | |
tree | 0f94869895530d5f8b16631aa164bbcf4cd3e9d4 /src/client/util/Scripting.ts | |
parent | 4c4ab22252aba8f08d8a384e2bd0c6696db9b43b (diff) | |
parent | 1e37adacfe5b44a71ed7d7dfd785c6c2d0808eae (diff) |
Merge branch 'master' into dataviz-ai-sarah
Diffstat (limited to 'src/client/util/Scripting.ts')
-rw-r--r-- | src/client/util/Scripting.ts | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/client/util/Scripting.ts b/src/client/util/Scripting.ts index f5e162d16..31222aa50 100644 --- a/src/client/util/Scripting.ts +++ b/src/client/util/Scripting.ts @@ -88,15 +88,10 @@ function Run(script: string | undefined, customParams: string[], diagnostics: an } const result = compiledFunction.apply(thisParam, params).apply(thisParam, argsArray); - if (batch) { - batch.end(); - } - + batch?.end(); return { success: true, result }; } catch (error) { - if (batch) { - batch.end(); - } + batch?.end(); onError?.(script + ' ' + error); return { success: false, error, result: errorVal }; } |