Main window: Fix exception when showing a page

Signed-off-by: Jerome Flesch <jflesch@wyplay.com>