Merge pull request #1855 from albertgasset/MOBILE-2838

MOBILE-2838 site: Fix checking whether no response is expected
main
Juan Leyva 2019-04-29 10:03:48 +02:00 committed by GitHub
commit 0daf5191ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -867,7 +867,8 @@ export class CoreSite {
} else {
let responseData = this.textUtils.parseJSON(response.data);
// Match the behaviour of CoreWSProvider.call when no response is expected.
if (!responseData && (typeof wsPresets.responseExpected == 'undefined' || wsPresets.responseExpected)) {
const responseExpected = typeof wsPresets.responseExpected == 'undefined' || wsPresets.responseExpected;
if (!responseExpected && (responseData == null || responseData === '')) {
responseData = {};
}
request.deferred.resolve(responseData);