Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null inside socket.data object's field #75

Open
yarikpetrenko opened this issue Nov 24, 2023 · 0 comments
Open

Null inside socket.data object's field #75

yarikpetrenko opened this issue Nov 24, 2023 · 0 comments

Comments

@yarikpetrenko
Copy link

yarikpetrenko commented Nov 24, 2023

I have middleware that sets socket.data and one of this object properties can be null. When socket.io-admin-ui in development mode it runs registerVerboseListeners function. Which laters calls createProxy function on "connection" event for every filed inside socket.data. Inside createProxy there is a check:

if (typeof obj !== "object") { return obj; }

but typeof null is also "object" so it will pass and will try to init new Proxy with null as target - new Proxy(null, ...) which will throw an error - "TypeError: Cannot create proxy with a non-object as target or handler" or similar.

In my case it also crash whole app when this error occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant