Apply strictNullChecks around the codebase (#10302

* Apply `strictNullChecks` around the codebase

* Iterate PR
This commit is contained in:
Michael Telatynski 2023-03-07 13:19:18 +00:00 committed by GitHub
parent 7c2bb966d0
commit 4b8bada24b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 112 additions and 77 deletions

View file

@ -858,8 +858,7 @@ async function readEvents(
const onMessage = function (event: MessageEvent<any>): void {
if (!event.origin) {
// stupid chrome
// @ts-ignore
// @ts-ignore - stupid chrome
event.origin = event.originalEvent.origin;
}
@ -867,10 +866,10 @@ const onMessage = function (event: MessageEvent<any>): void {
// This means the URL could contain a path (like /develop) and still be used
// to validate event origins, which do not specify paths.
// (See https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage)
let configUrl;
let configUrl: URL | undefined;
try {
if (!openManagerUrl) openManagerUrl = IntegrationManagers.sharedInstance().getPrimaryManager().uiUrl;
configUrl = new URL(openManagerUrl);
if (!openManagerUrl) openManagerUrl = IntegrationManagers.sharedInstance().getPrimaryManager()?.uiUrl;
configUrl = new URL(openManagerUrl!);
} catch (e) {
// No integrations UI URL, ignore silently.
return;
@ -987,7 +986,7 @@ const onMessage = function (event: MessageEvent<any>): void {
};
let listenerCount = 0;
let openManagerUrl: string | null = null;
let openManagerUrl: string | undefined;
export function startListening(): void {
if (listenerCount === 0) {