From b7401cffd3178f71971a42824a3ef4b49f5a1746 Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Wed, 3 May 2017 14:17:05 +0300 Subject: [PATCH] ImageView clear bitmap only when src is null/undefined (#4095) --- tns-core-modules/ui/image/image.android.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tns-core-modules/ui/image/image.android.ts b/tns-core-modules/ui/image/image.android.ts index 7dc00392f..057781555 100644 --- a/tns-core-modules/ui/image/image.android.ts +++ b/tns-core-modules/ui/image/image.android.ts @@ -66,17 +66,18 @@ export class Image extends ImageBase { } public _createImageSourceFromSrc() { - let imageView = this.nativeView; - if (imageView) { - imageView.setUri(null, 0, 0, false, true); - } - - if (!imageView || !this.src) { + const imageView = this.nativeView; + if (!imageView) { return; } let value = this.src; - let async = this.loadMode === ASYNC; + if (!value) { + imageView.setUri(null, 0, 0, false, true); + return; + } + + const async = this.loadMode === ASYNC; if (typeof value === "string" || value instanceof String) { value = value.trim();