Skip to content

Commit

Permalink
Merge pull request #144 from w3bdesign/dev
Browse files Browse the repository at this point in the history
Fiks "Object may be null"
  • Loading branch information
w3bdesign authored Apr 21, 2022
2 parents a0de3e8 + fe9817a commit a3223f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion scripts/classes/ProcessInputForm/classProcessInputForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ export default class classProcessInputForm {
* @param {string} value Value that we modify with
*/
private static setInnerHTML(elementId: string, value: string) {
window.document.getElementById(elementId).innerHTML = value;
const element = window.document.getElementById(elementId);

if (element && value) {
element.innerHTML = value;
}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions scripts/classes/ValidText/classValidText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export default class classValidText {
bilInformasjon !== undefined &&
bilInformasjon.length === 7
) {
submitButton.removeAttribute("disabled");
submitButton?.removeAttribute("disabled");
} else {
submitButton.setAttribute("disabled", "true");
submitButton?.setAttribute("disabled", "true");
}
};
}

1 comment on commit a3223f7

@vercel
Copy link

@vercel vercel bot commented on a3223f7 Apr 21, 2022

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.