Fix "Use Multiple Windows" crash

Fix crash when user tries to open another file
and the "Use Multiple Windows" option is selected.