We should check the state of getCurrentlyViewedFile() too