diff options
author | bobzel <zzzman@gmail.com> | 2020-10-30 14:33:19 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-10-30 14:33:19 -0400 |
commit | 9466146ce6c2684c2fe8abd8fcab9cf8a13a455e (patch) | |
tree | 7ba0c4b818dcfc36be13556638550ee162c629e8 /src/fields/ScriptField.ts | |
parent | 5667bb53b3f3fa1325df6f92d9f8f11f33d6beac (diff) |
from last
Diffstat (limited to 'src/fields/ScriptField.ts')
-rw-r--r-- | src/fields/ScriptField.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fields/ScriptField.ts b/src/fields/ScriptField.ts index 47efccc99..024017302 100644 --- a/src/fields/ScriptField.ts +++ b/src/fields/ScriptField.ts @@ -196,7 +196,7 @@ export class ComputedField extends ScriptField { } Scripting.addGlobal(function getIndexVal(list: any[], index: number) { - return list.reduce((p, x, i) => (i <= index && x !== undefined) || p === undefined ? x : p, undefined as any); + return list?.reduce((p, x, i) => (i <= index && x !== undefined) || p === undefined ? x : p, undefined as any); }, "returns the value at a given index of a list", "(list: any[], index: number)"); Scripting.addGlobal(function makeScript(script: string) { |