Skip to content

Commit

Permalink
Fix issue where targetNode.body.filter is called when targetNode.body…
Browse files Browse the repository at this point in the history
… is not an array (#108)

Fixes #99
  • Loading branch information
BenBaryoPX authored Jan 14, 2024
1 parent 7d4066b commit 9b90243
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/safe/unwrapIIFEs.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function unwrapIIFEs(arb, candidateFilter = () => true) {
targetChild = targetNode;
targetNode = targetNode.parentNode;
}
if (!targetNode || !targetNode.body) targetNode = n;
if (!targetNode?.body?.filter) targetNode = n;
else {
// Place the wrapped code instead of the wrapper node
replacementNode = {
Expand Down

0 comments on commit 9b90243

Please sign in to comment.