version: Avoid referencing a null object

This commit is contained in:
Alexander Nicolaysen Sørnes
2009-01-30 22:03:12 +01:00
parent ebc492dc1f
commit 5b3bde2210

View File

@@ -1110,14 +1110,17 @@ class version {
////////////////////////////// //////////////////////////////
// show the test results table // show the test results table
if($oTest->iTestingId) if($oTest)
{ {
$oTest->ShowVersionsTestingTable($this->objectMakeUrl()."&iTestingId=", 5); if($oTest->iTestingId)
} else if($oTest) /* We are previewing the version */ {
{ $oTest->ShowVersionsTestingTable($this->objectMakeUrl()."&iTestingId=", 5);
$oTable = $oTest->CreateTestTable(); } else /* We are previewing the version */
$oTable->AddRow($oTest->CreateTestTableRow(0, "")); {
echo $oTable->GetString(); $oTable = $oTest->CreateTestTable();
$oTable->AddRow($oTest->CreateTestTableRow(0, ""));
echo $oTable->GetString();
}
} }
if($_SESSION['current']->isLoggedIn()) if($_SESSION['current']->isLoggedIn())