summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-11-07 23:29:23 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-11-09 12:30:43 +0100
commit53e56b4d569d42422f16f07801124906effbd34d (patch)
treea5acf208cc27cb1fb861c49c8527d6a6c4af370b /apps/files_sharing/src
parent72545ffd07a07f142c9c18b3e4afc9ae1b5c8da2 (diff)
downloadnextcloud-server-53e56b4d569d42422f16f07801124906effbd34d.tar.gz
nextcloud-server-53e56b4d569d42422f16f07801124906effbd34d.zip
Fix js search in undefined ocs response
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r--apps/files_sharing/src/mixins/ShareRequests.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_sharing/src/mixins/ShareRequests.js b/apps/files_sharing/src/mixins/ShareRequests.js
index caae4fa4481..8c54eb15dce 100644
--- a/apps/files_sharing/src/mixins/ShareRequests.js
+++ b/apps/files_sharing/src/mixins/ShareRequests.js
@@ -53,7 +53,7 @@ export default {
async createShare({ path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label }) {
try {
const request = await axios.post(shareUrl, { path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label })
- if (!('ocs' in request.data)) {
+ if (!request?.data?.ocs) {
throw request
}
return new Share(request.data.ocs.data)
@@ -73,7 +73,7 @@ export default {
async deleteShare(id) {
try {
const request = await axios.delete(shareUrl + `/${id}`)
- if (!('ocs' in request.data)) {
+ if (!request?.data?.ocs) {
throw request
}
return true
@@ -93,7 +93,7 @@ export default {
async updateShare(id, properties) {
try {
const request = await axios.put(shareUrl + `/${id}`, properties, headers)
- if (!('ocs' in request.data)) {
+ if (!request?.data?.ocs) {
throw request
}
return true