From 48d3582107b46d8d3009df9edb50ce585adbdad4 Mon Sep 17 00:00:00 2001 From: Absurdon Date: Thu, 23 Nov 2017 21:47:07 +0100 Subject: [PATCH] Hopefully preventing application from crashing should hive not respond properly --- lib/hive/stats_wrapper.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/hive/stats_wrapper.js b/lib/hive/stats_wrapper.js index 69fa423..6c0bf8a 100644 --- a/lib/hive/stats_wrapper.js +++ b/lib/hive/stats_wrapper.js @@ -89,6 +89,9 @@ const StatAttributes = { }; function UserStatisticsWrapper (apiResponse) { + if(apiResponse === undefined) { + apiResponse = {}; + } for (let attr in StatAttributes) { let adapter = StatAttributes[attr]; this[attr] = apiResponse[adapter.v1] ||