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;