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
This commit is contained in:
Daniel Büchele
2019-04-08 03:04:59 -07:00
committed by Facebook Github Bot
parent fa3dcdc5dd
commit 6741c55b72

View File

@@ -203,7 +203,7 @@ function getRootContextMenu(data: Object): Array<Electron$MenuItemOptions> {
},
},
];
if (data instanceof Object) {
if (typeof data === 'object' && data !== null) {
rootContextMenuCache.set(data, menu);
} else {
console.error(