MOBILE-2838 site: Fix checking whether no response is expected

main
Albert Gasset 2019-04-26 16:51:43 +02:00
parent c682ff8673
commit 44eb98da3e
1 changed files with 2 additions and 1 deletions

View File

@ -866,7 +866,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);