From 6741c55b72ac4b8eaa8876044b22b6fe84b96977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=BCchele?= Date: Mon, 8 Apr 2019 03:04:59 -0700 Subject: [PATCH] fix "cannnot convert object to primitve value" Summary: The `instanceof Object` check was throwing an "cannnot convert object to primitve value" error, for some reason that I didn't fully understand. Replacing this check with a `typeof` check. However, `null` also returns `object`, so we are explictly checking this as well. This was the error that happened before, on every POST request: https://pxl.cl/vc6K Reviewed By: passy Differential Revision: D14827145 fbshipit-source-id: 999480db9afb1e0cc0d1bef73fb0cb2223fa0bc4 --- src/ui/components/data-inspector/DataInspector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/components/data-inspector/DataInspector.js b/src/ui/components/data-inspector/DataInspector.js index faccc9185..36abc455e 100644 --- a/src/ui/components/data-inspector/DataInspector.js +++ b/src/ui/components/data-inspector/DataInspector.js @@ -203,7 +203,7 @@ function getRootContextMenu(data: Object): Array { }, }, ]; - if (data instanceof Object) { + if (typeof data === 'object' && data !== null) { rootContextMenuCache.set(data, menu); } else { console.error(