From ba78d1a9ae80b9d8fed2783031c4a7a3d032ce31 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 21 Aug 2019 14:30:04 -0600 Subject: [PATCH] JSON is JSON --- src/http-api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http-api.js b/src/http-api.js index 76990c052..0b2f68a25 100644 --- a/src/http-api.js +++ b/src/http-api.js @@ -431,7 +431,7 @@ module.exports.MatrixHttpApi.prototype = { // option as we do with the home server, but it does return JSON, so // parse it manually return defer.promise.then(function(response) { - return JSON.parse(response); + return typeof(response) === 'string' ? JSON.parse(response) : response; }); },