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.
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 callscreateProxy
function on "connection" event for every filed inside socket.data. InsidecreateProxy
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.