Skip to content

Commit

Permalink
Fix a panic (#4294)
Browse files Browse the repository at this point in the history
  • Loading branch information
nono authored Jan 17, 2024
2 parents d88b394 + 6cb026a commit b94ab5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/sharing/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b94ab5a

Please sign in to comment.