From 5bdfbd490b9079a380a223f45bfc17101c05ade9 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Thu, 15 Sep 2022 11:19:43 +0200 Subject: [PATCH] fix possible nil pointer --- changelog/unreleased/add-privatelink-dav.md | 1 + internal/http/services/owncloud/ocdav/propfind/propfind.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog/unreleased/add-privatelink-dav.md b/changelog/unreleased/add-privatelink-dav.md index d91cb1fa63..b743ba0eef 100644 --- a/changelog/unreleased/add-privatelink-dav.md +++ b/changelog/unreleased/add-privatelink-dav.md @@ -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 diff --git a/internal/http/services/owncloud/ocdav/propfind/propfind.go b/internal/http/services/owncloud/ocdav/propfind/propfind.go index 6a07c932df..bfe39b70c4 100644 --- a/internal/http/services/owncloud/ocdav/propfind/propfind.go +++ b/internal/http/services/owncloud/ocdav/propfind/propfind.go @@ -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 {