From 17cc067e2516439d60e47b9dc93e2e4cfa5c03ae Mon Sep 17 00:00:00 2001 From: Rossen Hristov Date: Thu, 2 Jun 2016 15:18:23 +0300 Subject: [PATCH] Trying to fix the Travis build. --- tns-core-modules/ui/animation/animation.android.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tns-core-modules/ui/animation/animation.android.ts b/tns-core-modules/ui/animation/animation.android.ts index 58cc98df1..826621601 100644 --- a/tns-core-modules/ui/animation/animation.android.ts +++ b/tns-core-modules/ui/animation/animation.android.ts @@ -376,18 +376,20 @@ export class Animation extends common.Animation implements definition.Animation private _enableHardwareAcceleration() { for (let i = 0, length = this._propertyAnimations.length; i < length; i++) { let cache = this._propertyAnimations[i].target._nativeView; - let layerType = cache.getLayerType(); - if (layerType !== android.view.View.LAYER_TYPE_HARDWARE) { - cache.layerType = layerType; - cache.setLayerType(android.view.View.LAYER_TYPE_HARDWARE, null); - } + if (cache){ + let layerType = cache.getLayerType(); + if (layerType !== android.view.View.LAYER_TYPE_HARDWARE) { + cache.layerType = layerType; + cache.setLayerType(android.view.View.LAYER_TYPE_HARDWARE, null); + } + } } } private _disableHardwareAcceleration() { for (let i = 0, length = this._propertyAnimations.length; i < length; i++) { let cache = this._propertyAnimations[i].target._nativeView; - if (cache.layerType !== undefined) { + if (cache && cache.layerType !== undefined) { cache.setLayerType(cache.layerType, null); cache.layerType = undefined; }