Skip to content
This repository was archived by the owner on Jun 5, 2024. It is now read-only.

fix: avoid error on depth 0 propfind #1128

Merged
merged 1 commit into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/bugfix-depth-0-propfind
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Depth 0 PROPFIND on empty responses

We fixed a bug where depth 0 PROPFINDs resulted in an exception when the response is empty. This was happening when requesting only certain props in the PROPFIND and those were not present.

https://github.com/owncloud/owncloud-sdk/pull/1128
4 changes: 3 additions & 1 deletion src/fileManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ class Files {
return Promise.reject(this.helpers.buildHttpErrorFromDavResponse(result.status, result.body))
} else {
const entries = this.helpers._parseBody(result.body)
entries[0].tusSupport = this.helpers._parseTusHeaders(result.res)
if (entries.length) {
entries[0].tusSupport = this.helpers._parseTusHeaders(result.res)
}
return Promise.resolve(entries)
}
})
Expand Down