From c2b459a8529e295434f3728399bf798616cfbdef Mon Sep 17 00:00:00 2001 From: Weronika K Date: Tue, 12 Dec 2023 13:07:06 +0100 Subject: [PATCH] fix: banner NPE --- src/types/collection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/collection.ts b/src/types/collection.ts index 032ea01..8ae4fe8 100644 --- a/src/types/collection.ts +++ b/src/types/collection.ts @@ -9,7 +9,7 @@ export class Collection extends Node { code: string; creator: string; owner: string; - banner: FileVersion; + banner?: FileVersion; thumbnail?: FileVersion; udl?: UDL; ucm?: boolean; @@ -23,7 +23,7 @@ export class Collection extends Node { this.code = collectionProto.code; this.creator = collectionProto.creator; this.owner = collectionProto.owner; - this.banner = new FileVersion(collectionProto.banner); + this.banner = collectionProto.banner ? new FileVersion(collectionProto.banner): undefined; this.thumbnail = collectionProto.thumbnail ? new FileVersion(collectionProto.thumbnail) : undefined; this.udl = collectionProto.udl; this.ucm = collectionProto.ucm;