From 035e3816731d963c4562475f0a8ac6478d870a5f Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Fri, 28 Aug 2015 11:16:26 +0300 Subject: [PATCH] throw error if not string --- ui/core/view-common.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/core/view-common.ts b/ui/core/view-common.ts index 788fe65d0..19c6b76c5 100644 --- a/ui/core/view-common.ts +++ b/ui/core/view-common.ts @@ -924,9 +924,11 @@ export class View extends proxy.ProxyObject implements definition.View { } public setStyle(style: string): void { - if (types.isString(style)) { - this._applyInlineStyle(style); + if (!types.isString(style)) { + throw new Error("Parameter should be valid CSS string!"); } + + this._applyInlineStyle(style); } public _updateLayout() {