diff --git a/src/classes/site.ts b/src/classes/site.ts index 8f8bc3c0d..6861a6b8c 100644 --- a/src/classes/site.ts +++ b/src/classes/site.ts @@ -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);