Don't go nuts if we aren't attached to a window

This seems to happen if the status bar is used when in a unit test and there isn't a window available. If we don't return nil here the main window root will be used and the root of that is the status bar.