Fixed missing check for new permission-type.

Added another NPE protection on project deletion.