From 6cb026a31879daa72b06e399683d9d8c8f533391 Mon Sep 17 00:00:00 2001 From: Bruno Michel Date: Wed, 17 Jan 2024 09:49:52 +0100 Subject: [PATCH] Fix a panic --- model/sharing/files.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/sharing/files.go b/model/sharing/files.go index 73718b095d0..a4eb140842f 100644 --- a/model/sharing/files.go +++ b/model/sharing/files.go @@ -265,13 +265,13 @@ func (s *Sharing) CreateDirForSharing(inst *instance.Instance, rule *Rule, paren return nil, err } dir, err := vfs.NewDirDocWithParent(rule.Title, parent, []string{"from-sharing-" + s.SID}) - parts := strings.Split(rule.Values[0], "/") - dir.DocID = parts[len(parts)-1] if err != nil { inst.Logger().WithNamespace("sharing"). Warnf("CreateDirForSharing failed to make dir: %s", err) return nil, err } + parts := strings.Split(rule.Values[0], "/") + dir.DocID = parts[len(parts)-1] dir.AddReferencedBy(couchdb.DocReference{ ID: s.SID, Type: consts.Sharings,