Fix crash because view.file_name() is None for console view

Fix #46