Don't crash on a null QWindow
The earlier code checked for that, that check got removed inadvertently
Also restructure code to always emit the result signal in case of errors
The earlier code checked for that, that check got removed inadvertently
Also restructure code to always emit the result signal in case of errors