Fix Exception for project closure that contained closed project

When asking for the closure of a project where one of the of the
projects in the dependency chain was closed an exception would
be thrown.

This is now fixed and I added a test that failed before the
fix but works now

Fixes #1001810
Merge pull request #72 from mads379/1001810-ResourceException-for-closed-project

1001810 Fix Exception for project closure that contained closed project