Strange behaviour getWindow returns null

Hello

Can anyone explain me the following : why getWindow returns null in the try block , but in the catch block it returns me the Window object.
for instance on the button btn_Save (defined on a component that is added to another component)

	btn_Save.addListener(new ClickListener()
		{

			@Override
			public void buttonClick(ClickEvent event)
			{
				try
				{
                                           // do all sorts of stuff
                                           Window win = getWindow();   // returns NULL
				}
                                   catch (Exception e)
				{    // here getWindow returns the current window.
					getWindow().showNotification("Error", Window.Notification.TYPE_ERROR_MESSAGE);
				}
			}
                    }

When the button is clicked, the components are already attached, so it should return me the parent window right ?