diff --git a/ui/styling/background.android.ts b/ui/styling/background.android.ts index bdf46cee5..792ef156f 100644 --- a/ui/styling/background.android.ts +++ b/ui/styling/background.android.ts @@ -153,17 +153,16 @@ export module ad { var backgroundValue = v.style._getValue(style.backgroundInternalProperty); var borderWidth = v.borderWidth; + var bkg = nativeView.getBackground(); - if (v.borderWidth === 0 && v.borderRadius === 0 && + if (!types.isNullOrUndefined(bkg) && v.borderWidth === 0 && v.borderRadius === 0 && !v.style._getValue(style.backgroundImageProperty) && v.style._getValue(style.backgroundColorProperty)) { - let bkg = nativeView.getBackground(); if (bkg && bkg.setColorFilter) { bkg.setColorFilter(v.style._getValue(style.backgroundColorProperty).android, android.graphics.PorterDuff.Mode.SRC_IN); } } else if (v.borderWidth !== 0 || v.borderRadius !== 0 || !backgroundValue.isEmpty()) { - let bkg = nativeView.getBackground(); if (!(bkg instanceof dts.ad.BorderDrawable)) { bkg = new dts.ad.BorderDrawable(); let viewClass = types.getClass(v);