Skip to content

Commit c5015d6

Browse files
Maxime MENAGERmaximemenager
Maxime MENAGER
authored andcommitted
Use doc instead of err for doc existence checking
1 parent c6d5451 commit c5015d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/sharing/sharing.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (s *Sharing) BeOwner(inst *instance.Instance, slug string) error {
152152
// CreatePreviewPermissions creates the permissions doc for previewing this sharing,
153153
// or updates it with the new codes if the document already exists
154154
func (s *Sharing) CreatePreviewPermissions(inst *instance.Instance) (map[string]string, error) {
155-
doc, err := permissions.GetForSharePreview(inst, s.SID)
155+
doc, _ := permissions.GetForSharePreview(inst, s.SID)
156156

157157
codes := make(map[string]string, len(s.Members)-1)
158158
for i, m := range s.Members {
@@ -192,9 +192,9 @@ func (s *Sharing) CreatePreviewPermissions(inst *instance.Instance) (map[string]
192192
}
193193
}
194194

195-
if err == nil {
195+
if doc != nil {
196196
doc.Codes = codes
197-
if err = couchdb.UpdateDoc(inst, doc); err != nil {
197+
if err := couchdb.UpdateDoc(inst, doc); err != nil {
198198
return nil, err
199199
}
200200
} else {

0 commit comments

Comments
 (0)