[MNG-5613] Avoid NPE when dependency graph creation fails

As described in MNG-5613 a NPE occurs if the dependency graph creation fails. Errors where properly catched and added to the result. However, after the call to createProjectDependencyGraph, the resulting projectDependencyGraph was null and as result was not checked for exceptions the call to projectDependencyGraph.getSortedProjects() resulted in a NPE.