file: fixed NPE when file is closed