Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 4b5846a

Browse files
committed
Fix being unable to require es6-map on first attempt
Object.keys called on false was causing: TypeError: Object.keys called on non-object Close #1719
1 parent 3501807 commit 4b5846a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

node/ltnodeclient.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,14 @@ function sbRequire(require, resolve, path) {
105105
}
106106

107107
var curSb = getSB(path);
108-
if(typeof(curSb.module.exports) == "function" || Object.keys(curSb.module.exports).length) {
109-
return curSb.module.exports;
108+
var exports = curSb.module.exports;
109+
if(typeof(exports) == "function" || ((typeof exports === 'object') && (exports !== null) && Object.keys(exports).length)) {
110+
return exports;
110111
}
111-
if(typeof(curSb.exports) == "function" || Object.keys(curSb.exports).length) {
112+
if(typeof(curSb.exports) == "function" || ((typeof curSb.exports === 'object') && (curSb.exports !== null) && Object.keys(curSb.exports).length)) {
112113
return curSb.exports;
113114
}
114-
return curSb.module.exports;
115+
return exports;
115116
}
116117

117118

0 commit comments

Comments
 (0)