Fixes NPE when some file is in error state