We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If there is something like JSON.parse(null); and we use #%#//scriptlet('json-prune'), then script throws error.
JSON.parse(null);
#%#//scriptlet('json-prune')
Steps to reproduce
example.org#%#//scriptlet('json-prune')
(() => { console.log('start'); JSON.parse(null); console.log('end'); })();
Uncaught TypeError: Cannot convert undefined or null to object
If I'm not wrong, the problem is with isEmptyObject:
isEmptyObject
Scriptlets/src/helpers/object-utils.js
Line 38 in c33826b
null
Related to - AdguardTeam/AdguardFilters#140217 Website is broken after adding rule like this:
crackle.com#%#//scriptlet('json-prune')
to user rules.
The text was updated successfully, but these errors were encountered:
json-prune
AG-18869 Improve json-prune — fix issue with logging null. #282
d6edd08
Squashed commit of the following: commit b4a5884 Merge: 98cedec 85e6beb Author: Adam Wróblewski <[email protected]> Date: Tue Feb 28 15:14:09 2023 +0100 Merge branch 'master' into fix/AG-18869 commit 98cedec Author: Adam Wróblewski <[email protected]> Date: Mon Feb 27 18:05:45 2023 +0100 Remove objectToString from import and related helpers Update comment Update logMessage description commit 3cda968 Author: Adam Wróblewski <[email protected]> Date: Wed Feb 22 13:01:35 2023 +0100 Fix test commit 68cf621 Author: Adam Wróblewski <[email protected]> Date: Tue Feb 21 16:58:23 2023 +0100 Fix issue with logging null Improve logging
slavaleleka
No branches or pull requests
If there is something like
JSON.parse(null);
and we use#%#//scriptlet('json-prune')
, then script throws error.Steps to reproduce
Screenshot
If I'm not wrong, the problem is with
isEmptyObject
:Scriptlets/src/helpers/object-utils.js
Line 38 in c33826b
It throws error for
null
.Related to - AdguardTeam/AdguardFilters#140217
Website is broken after adding rule like this:
to user rules.
The text was updated successfully, but these errors were encountered: