Fix API initialization, closes #861

This commit is contained in:
Alexander Zobnin
2020-05-20 14:54:21 +03:00
parent 4c462e72dc
commit d18e6cc675
3 changed files with 18 additions and 8 deletions

View File

@@ -86,10 +86,12 @@ function cacheRequest(func, funcName, funcScope, self) {
} else {
return func.apply(funcScope, arguments)
.then(result => {
cacheObject[hash] = {
value: result,
timestamp: Date.now()
};
if (result !== undefined) {
cacheObject[hash] = {
value: result,
timestamp: Date.now()
};
}
return result;
});
}