From 0e1bb20c9e0cfe52301ba7503b322e97ebcddb2b Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 26 Aug 2019 08:32:40 +0200 Subject: [PATCH] MOBILE-3068 core: Fix cannot read indexOf null in external-content --- src/directives/external-content.ts | 2 +- src/directives/format-text.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/directives/external-content.ts b/src/directives/external-content.ts index fac78ee17..e70858ab0 100644 --- a/src/directives/external-content.ts +++ b/src/directives/external-content.ts @@ -150,7 +150,7 @@ export class CoreExternalContentDirective implements AfterViewInit, OnChanges { } // Avoid handling data url's. - if (url.indexOf('data:') === 0) { + if (url && url.indexOf('data:') === 0) { this.invalid = true; return; diff --git a/src/directives/format-text.ts b/src/directives/format-text.ts index 1335b31de..e8bafbbab 100644 --- a/src/directives/format-text.ts +++ b/src/directives/format-text.ts @@ -468,7 +468,7 @@ export class CoreFormatTextDirective implements OnChanges { // Wait for images to load. let promise: Promise = null; if (externalImages.length) { - promise = Promise.all(externalImages.map((externalImage) => { + promise = Promise.all(externalImages.map((externalImage): any => { if (externalImage.loaded) { // Image has already been loaded, no need to wait. return Promise.resolve();