Skip to content

Commit 476fa19

Browse files
author
John McCambridge
committed
Check if form exists
1 parent 850a724 commit 476fa19

File tree

1 file changed

+4
-0
lines changed
  • packages/app/browser/src

1 file changed

+4
-0
lines changed

packages/app/browser/src/app.ts

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ window.addEventListener("message", (event) => {
2222
const password = document.getElementById("password") as HTMLInputElement;
2323
const form = document.getElementById("login-form") as HTMLFormElement;
2424

25+
if (!form) {
26+
throw new Error("No password form found");
27+
}
28+
2529
form.addEventListener("submit", (e) => {
2630
e.preventDefault();
2731
document.cookie = `password=${password.value}`;

0 commit comments

Comments
 (0)