Added warning if asWidget is called while being null

my point is that the isWidget could be called before to attach the widget into the dom and we should throw an exception only when the widget is attached. So for me it's not the right place to put this check...

Even if I agree that this change will work in most of the case because the initWidget is normally called in the view's constructor.