Skip to content

Commit

Permalink
fix possible nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar committed Sep 15, 2022
1 parent 3358dc7 commit 5bdfbd4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/unreleased/add-privatelink-dav.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Enhancement: Add privatelink to PROPFIND response
We made it possible to request a privatelink WebDAV property.

https://github.com/cs3org/reva/pull/3239
https://github.com/cs3org/reva/pull/3240
2 changes: 1 addition & 1 deletion internal/http/services/owncloud/ocdav/propfind/propfind.go
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p
}
case "privatelink":
privateURL, err := url.Parse(publicURL)
if err == nil {
if err == nil && md.Id != nil {
privateURL.Path = path.Join(privateURL.Path, "f", storagespace.FormatResourceID(*md.Id))
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:privatelink", privateURL.String()))
} else {
Expand Down

0 comments on commit 5bdfbd4

Please sign in to comment.