Skip to content

Commit

Permalink
Fix: Patch removal check
Browse files Browse the repository at this point in the history
Checks against possible undefined `input` or `output` results in error when connecting `input` to `input` or `output` to `output`.
  • Loading branch information
rihardsgravis authored Jan 20, 2021
2 parents a3759ac + 96d9c34 commit 9830c53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/state/patches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Patches {
this.patches.update(($patches) => {
return $patches.filter(($patch) => {
if (!input) {
return $patch.input.indexOf(output) !== 0 && $patch.output.indexOf(output) !== 0;
return $patch.input?.indexOf(output) !== 0 && $patch.output?.indexOf(output) !== 0;
}
return !($patch.input === input && $patch.output === output);
});
Expand Down

1 comment on commit 9830c53

@vercel
Copy link

@vercel vercel bot commented on 9830c53 Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.