Don't display anything when the id is invalid.
The previous default of displaying top-level projects when the id is
invalid is just confusing.
Change-Id: If78a54088f7ec4bc68098a7b834a39a576bc641b
diff --git a/tools/report.php b/tools/report.php
index 1628355..0ab1252 100755
--- a/tools/report.php
+++ b/tools/report.php
@@ -188,18 +188,22 @@
<p>EXPERIMENTAL. This page shows some basic metrics.</p>
<?php
-$project = Project::getProject($id);
-if ($project) {
- renderProjectReport($project, $options, $showCommitters);
- if ($showSubprojects) {
- foreach($project->getChildren() as $child) {
- renderProjectReport($child, $options, false);
- }
- }
-} else {
+if ($id == null) {
foreach(Project::getTopLevelProjects() as $project) {
renderProjectReport($project, $options, false);
}
+} else {
+ $project = Project::getProject($id);
+ if ($project) {
+ renderProjectReport($project, $options, $showCommitters);
+ if ($showSubprojects) {
+ foreach($project->getChildren() as $child) {
+ renderProjectReport($child, $options, false);
+ }
+ }
+ } else {
+ print "<p>There is no project with that ID.</p>";
+ }
}
?>
</div>