Conform more code to strict null checking (#10167)

* Conform more code to strict null checking

* Delint

* Iterate PR based on feedback
This commit is contained in:
Michael Telatynski 2023-02-16 17:21:44 +00:00 committed by GitHub
parent f7bea2cae5
commit 4574c665ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
103 changed files with 517 additions and 495 deletions

View file

@ -96,7 +96,7 @@ export default class WidgetUtils {
* @param {[type]} testUrlString URL to check
* @return {Boolean} True if specified URL is a scalar URL
*/
public static isScalarUrl(testUrlString: string): boolean {
public static isScalarUrl(testUrlString?: string): boolean {
if (!testUrlString) {
logger.error("Scalar URL check failed. No URL specified");
return false;
@ -554,7 +554,7 @@ export default class WidgetUtils {
// noinspection JSIgnoredPromiseFromCall
IntegrationManagers.sharedInstance()
.getPrimaryManager()
.open(room, "type_" + app.type, app.id);
?.open(room, "type_" + app.type, app.id);
}
public static isManagedByManager(app: IApp): boolean {
@ -563,7 +563,7 @@ export default class WidgetUtils {
if (managers.hasManager()) {
// TODO: Pick the right manager for the widget
const defaultManager = managers.getPrimaryManager();
return WidgetUtils.isScalarUrl(defaultManager.apiUrl);
return WidgetUtils.isScalarUrl(defaultManager?.apiUrl);
}
}
return false;