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

Setting object in KV with null as object property crashes DPP #4

Open
WilfBanger opened this issue Sep 4, 2024 · 1 comment
Open

Comments

@WilfBanger
Copy link

I'm new to DPP and KV so I may be doing things incorrectly. I have created a KV object following the examples and am using the set method to store a value (like myDb.set(key, value)). If the value is an object and a property of the object has a null value, DPP crashes in the proxify method.

This seems to be because it checks for "objectness" using typeof X === 'object' which is true for null. It then calls proxify recursively on that null which fails.

@robtweed
Copy link
Owner

Yes - DPP's objects are proxy objects and, as such, currently need to be pre-sanitised before you should feed anything into it. I'll maybe take a look at whether anything can be done within DPP itself to protect against such errors

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

2 participants