1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

JSON is JSON

This commit is contained in:
Travis Ralston
2019-08-21 14:30:04 -06:00
parent 241811298f
commit ba78d1a9ae

View File

@@ -431,7 +431,7 @@ module.exports.MatrixHttpApi.prototype = {
// option as we do with the home server, but it does return JSON, so // option as we do with the home server, but it does return JSON, so
// parse it manually // parse it manually
return defer.promise.then(function(response) { return defer.promise.then(function(response) {
return JSON.parse(response); return typeof(response) === 'string' ? JSON.parse(response) : response;
}); });
}, },