Skip to content

Commit

Permalink
check whether element is correct type
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewHEguardian committed Nov 23, 2023
1 parent 55cd4a0 commit f5e0965
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client/HelpCentrePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if (typeof window !== 'undefined' && window.guardian && window.guardian.dsn) {
});
}

const element = document.getElementById('app') as HTMLElement;
const element = document.getElementById('app');
if (!(element instanceof HTMLElement)) throw Error('Invalid app element');
const root = createRoot(element);
root.render(HelpCentrePage);
3 changes: 2 additions & 1 deletion client/MMAPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if (typeof window !== 'undefined' && window.guardian && window.guardian.dsn) {
});
}

const element = document.getElementById('app') as HTMLElement;
const element = document.getElementById('app');
if (!(element instanceof HTMLElement)) throw Error('Invalid app element');
const root = createRoot(element);
root.render(MMAPage);

0 comments on commit f5e0965

Please sign in to comment.