Removed possible NullPointerExceptions.

They could trigger on certain deletions or renamings when executed from
the "RelatedProjectView".