From 17d0172ace7f8070bfe11a8f9898bc158ad940a6 Mon Sep 17 00:00:00 2001 From: Maya Zhecheva Date: Mon, 1 Aug 2016 16:21:26 +0300 Subject: [PATCH] Element that is not an instance of a View should not be added to its parent. --- tns-core-modules/ui/core/view-common.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tns-core-modules/ui/core/view-common.ts b/tns-core-modules/ui/core/view-common.ts index 7f3063a67..ec99314d9 100644 --- a/tns-core-modules/ui/core/view-common.ts +++ b/tns-core-modules/ui/core/view-common.ts @@ -988,7 +988,10 @@ export class View extends ProxyObject implements definition.View { if (!view) { throw new Error("Expecting a valid View instance."); } - + if(!(view instanceof View)) + { + throw new Error(view + " is not a valid View instance."); + } if (view._parent) { throw new Error("View already has a parent. View: " + view + " Parent: " + view._parent); }