Merge pull request #3446 from matrix-org/bwindels/fixscalarurlcheck

Fix: make sure scalarUrls is never undefined
pull/21833/head
Bruno Windels 2019-09-16 15:43:03 +00:00 committed by GitHub
commit deddf77a05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -100,11 +100,14 @@ export default class WidgetUtils {
}
const testUrl = url.parse(testUrlString);
let scalarUrls = SdkConfig.get().integrations_widgets_urls;
if (!scalarUrls || scalarUrls.length === 0) {
const defaultManager = IntegrationManagers.sharedInstance().getPrimaryManager();
if (defaultManager) scalarUrls = [defaultManager.apiUrl];
if (defaultManager) {
scalarUrls = [defaultManager.apiUrl];
} else {
scalarUrls = [];
}
}
for (let i = 0; i < scalarUrls.length; i++) {