diff options
author | bobzel <zzzman@gmail.com> | 2023-09-21 15:01:48 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-09-21 15:01:48 -0400 |
commit | df112b865e068fe589327e7424f4155c76881539 (patch) | |
tree | 2ae99c21389d24867cb1da07176da765a1d42604 /src/fields/Doc.ts | |
parent | 34c64c47444e89bf900227a4f3c56d9023f5d4f3 (diff) |
fixed export of media
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 27da65342..7170be6cc 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -855,20 +855,20 @@ export namespace Doc { const proms = new Set<string>(); function replacer(key: any, value: any) { if (key && ['branchOf', 'cloneOf', 'cursors'].includes(key)) return undefined; - if (value.__type === 'image') { + if (value?.__type === 'image') { const extension = value.url.replace(/.*\./, ''); proms.add(value.url.replace('.' + extension, '_o.' + extension)); return SerializationHelper.Serialize(new ImageField(value.url)); } - if (value.__type === 'pdf') { + if (value?.__type === 'pdf') { proms.add(value.url); return SerializationHelper.Serialize(new PdfField(value.url)); } - if (value.__type === 'audio') { + if (value?.__type === 'audio') { proms.add(value.url); return SerializationHelper.Serialize(new AudioField(value.url)); } - if (value.__type === 'video') { + if (value?.__type === 'video') { proms.add(value.url); return SerializationHelper.Serialize(new VideoField(value.url)); } |