From 9b7fc3dd6f048d360b00052bd7791bf0ae91960f Mon Sep 17 00:00:00 2001 From: Josh Freda Date: Tue, 7 Nov 2023 11:30:32 -0600 Subject: [PATCH] Fix panic when document has no owners --- pkg/document/document.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/document/document.go b/pkg/document/document.go index b194f750e..7a75183df 100644 --- a/pkg/document/document.go +++ b/pkg/document/document.go @@ -346,7 +346,11 @@ func NewFromDatabaseModel( doc.ModifiedTime = model.DocumentModifiedAt.Unix() // Owners. - doc.Owners = []string{model.Owner.EmailAddress} + if model.Owner != nil { + doc.Owners = []string{model.Owner.EmailAddress} + } else { + doc.Owners = []string{} + } // Note: OwnerPhotos is not stored in the database.