Skip to content

Commit fcd7701

Browse files
committed
Fix regression in isObject (crashed w/ null values).
1 parent e262ee4 commit fcd7701

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

danfojs-browser/src/shared/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Utils {
6363
* @returns
6464
*/
6565
isObject(value) {
66-
return typeof value === "object" && value.constructor && value.constructor.name === "Object";
66+
return value && typeof value === "object" && value.constructor && value.constructor.name === "Object";
6767
}
6868

6969
/**

danfojs-node/src/shared/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Utils {
6363
* @returns
6464
*/
6565
isObject(value) {
66-
return typeof value === "object" && value.constructor && value.constructor.name === "Object";
66+
return value && typeof value === "object" && value.constructor && value.constructor.name === "Object";
6767
}
6868

6969
/**

0 commit comments

Comments
 (0)