Check if There is a View Before Checking the Doc
Summary:
This triggers a crash if there is no document open at the moment
something is added to or removed from the project.
Test Plan:
Close all documents and add something to the current
project.
Reviewers: Kile, mludwig
Reviewed By: Kile, mludwig
Tags: Kile
Differential Revision: https://phabricator.kde.org/D7445