diff options
author | bobzel <zzzman@gmail.com> | 2021-08-10 21:34:59 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-08-10 21:34:59 -0400 |
commit | 88074b6b085b0b5542759cb41519de719ee61cee (patch) | |
tree | 1c2f74358e6a603c17cefaf350e00d158d66ee20 /src | |
parent | fe78892ad8dd477779e0746918be373b9b5c15c0 (diff) |
fixed error when adding to a collection that does not have a list as its data
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/DocComponent.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index 99c695a4a..14d32ef12 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -219,7 +219,7 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps, T inheritParentAcls(CurrentUserUtils.ActiveDashboard, doc); }); const annoDocs = targetDataDoc[annotationKey ?? this.annotationKey] as List<Doc>; - if (annoDocs) annoDocs.push(...added); + if (annoDocs instanceof List) annoDocs.push(...added); else targetDataDoc[annotationKey ?? this.annotationKey] = new List<Doc>(added); targetDataDoc[(annotationKey ?? this.annotationKey) + "-lastModified"] = new DateField(new Date(Date.now())); } |