Skip to content

Commit 1d24724

Browse files
skjnldsvbackportbot[bot]
authored andcommitted
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>
1 parent 7b8ca95 commit 1d24724

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/files_sharing/src/mixins/ShareRequests.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default {
5353
async createShare({ path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label }) {
5454
try {
5555
const request = await axios.post(shareUrl, { path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label })
56-
if (!('ocs' in request.data)) {
56+
if (!request?.data?.ocs) {
5757
throw request
5858
}
5959
return new Share(request.data.ocs.data)
@@ -73,7 +73,7 @@ export default {
7373
async deleteShare(id) {
7474
try {
7575
const request = await axios.delete(shareUrl + `/${id}`)
76-
if (!('ocs' in request.data)) {
76+
if (!request?.data?.ocs) {
7777
throw request
7878
}
7979
return true
@@ -93,7 +93,7 @@ export default {
9393
async updateShare(id, properties) {
9494
try {
9595
const request = await axios.put(shareUrl + `/${id}`, properties, headers)
96-
if (!('ocs' in request.data)) {
96+
if (!request?.data?.ocs) {
9797
throw request
9898
}
9999
return true

0 commit comments

Comments
 (0)