Closed ajeffrey closed 8 years ago
just tested in the dist js and changing !_.isUndefined(obj)
to typeof obj === 'object' && obj
does the trick.
Great. Could you put together a PR with the fix?
will do
I've added the null check, let me know if you run into other issues.
oh ok, was going to submit a PR today but thanks :)
The proxy.isProxy() function doesn't check for null before checking for the __id string in an object (when calling .Mock.ofInstance).
Here's a rough replication of the issue in raw JS:
and here's the backtrace I get (against 1.0.1):
I suspect the fix would be to replace the _.isUndefined call with something that only proceeds if obj is a valid non-null object.