mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
throw error if not string
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user