Merge pull request #2074 from dpalou/MOBILE-3068

MOBILE-3068 core: Fix cannot read indexOf null in external-content
main
Dani Palou 2019-08-26 10:04:09 +02:00 committed by GitHub
commit aafab95e8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -468,7 +468,7 @@ export class CoreFormatTextDirective implements OnChanges {
// Wait for images to load.
let promise: Promise<any> = 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();