From f057880df38fd709f2d6a0309507be0ef9b52d68 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 18 May 2020 17:57:40 +0200 Subject: [PATCH] Backend: Fix panic in File.Save() Signed-off-by: Michael Mayer --- internal/entity/file.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/entity/file.go b/internal/entity/file.go index 6d90086fc..5cbee53f0 100644 --- a/internal/entity/file.go +++ b/internal/entity/file.go @@ -151,7 +151,9 @@ func (m *File) Save() error { return err } - return Db().Model(m).Related(Photo{}).Error + photo := Photo{} + + return Db().Model(m).Related(&photo).Error } // UpdateVideoInfos updates related video infos based on this file.