diff --git a/src/react/JSONTree/obj-type.js b/src/react/JSONTree/obj-type.js index 095ee2d7..40dfd8d1 100644 --- a/src/react/JSONTree/obj-type.js +++ b/src/react/JSONTree/obj-type.js @@ -1,7 +1,6 @@ export default function(obj) { - const type = Object.prototype.toString.call(obj).slice(8, -1); - if (type === 'Object' && typeof obj[Symbol.iterator] === 'function') { + if (obj !== null && typeof obj === 'object' && typeof obj[Symbol.iterator] === 'function') { return 'Iterable'; } - return type; + return Object.prototype.toString.call(obj).slice(8, -1); }