From 363b08c4d8c71ba4f66c4a788032fb20350ea4ad Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 22 Feb 2016 10:34:43 +0000 Subject: [PATCH] don't NPE on 50x's - as per BOTS-170 --- lib/http-api.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/http-api.js b/lib/http-api.js index 1951790e3..a3ab93cfa 100644 --- a/lib/http-api.js +++ b/lib/http-api.js @@ -501,6 +501,7 @@ var requestCallback = function(defer, userDefinedCallback, onlyData) { * @prop {integer} httpStatus The numeric HTTP status code given */ module.exports.MatrixError = function MatrixError(errorJson) { + errorJson = errorJson || {}; this.errcode = errorJson.errcode; this.name = errorJson.errcode || "Unknown error code"; this.message = errorJson.error || "Unknown message";