From 281e36fde75126caeb032afe9b92e716a3bb029f Mon Sep 17 00:00:00 2001 From: bradmcl <32770029+bradmcl@users.noreply.github.com> Date: Sat, 26 May 2018 21:06:51 -0400 Subject: [PATCH] Update file-api-driver-webdav.js --- ReactNativeClient/lib/file-api-driver-webdav.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactNativeClient/lib/file-api-driver-webdav.js b/ReactNativeClient/lib/file-api-driver-webdav.js index c0dc6fc5c..42bcb115a 100644 --- a/ReactNativeClient/lib/file-api-driver-webdav.js +++ b/ReactNativeClient/lib/file-api-driver-webdav.js @@ -43,8 +43,8 @@ class FileApiDriverWebDav { const propStat = this.api().arrayFromJson(resource, ['d:propstat']); if (!Array.isArray(propStat)) throw new Error('Invalid WebDAV resource format: ' + JSON.stringify(resource)); - const httpStatusCode = parseInt(propStat[0]['d:status'][0].split(' ')[1]); // Parsing "HTTP/1.1 200 OK" - if ( httpStatusCode === 404 ) throw new JoplinError(resource, 404); + const httpStatusLine = this.api().stringFromJson(resource, ['d:propstat',0,'d:status', 0]); + if ( typeof httpStatusLine === 'string' && httpStatusLine.split(' ')[1] === '404' ) throw new JoplinError(resource, 404); const resourceTypes = this.api().resourcePropByName(resource, 'array', 'd:resourcetype'); let isDir = false;