If file was removed from the model, sometimes the view is trying to access the removed data, so check if requested item is in the model.
Closes: #1025 (closed) Closes: #1059 (closed)