Skip to content

Commit

Permalink
sendForm: remove the Optional Chaining operator
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Khomushin committed Jun 14, 2021
1 parent 83c782a commit 858dcc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/methods/sendForm/sendForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const findHTMLForm = (form: string | HTMLFormElement): HTMLFormElement => {
currentForm = form;
}

if (currentForm?.nodeName !== 'FORM') {
if (!currentForm || currentForm.nodeName !== 'FORM') {
throw 'The 3rd parameter is expected to be the HTML form element or the style selector of form';
}

Expand Down

0 comments on commit 858dcc5

Please sign in to comment.