From 44eb98da3e27625f210268c99a33ea2c44bf026e Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Fri, 26 Apr 2019 16:51:43 +0200 Subject: [PATCH] MOBILE-2838 site: Fix checking whether no response is expected --- src/classes/site.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/classes/site.ts b/src/classes/site.ts index 8f01c4ad6..6584fe467 100644 --- a/src/classes/site.ts +++ b/src/classes/site.ts @@ -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);