From 5b3bde22109cfb8deda24db3243ccb5cd18adfab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Fri, 30 Jan 2009 22:03:12 +0100 Subject: [PATCH] version: Avoid referencing a null object --- include/version.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/include/version.php b/include/version.php index a5046f5..a7835f6 100644 --- a/include/version.php +++ b/include/version.php @@ -1110,14 +1110,17 @@ class version { ////////////////////////////// // show the test results table - if($oTest->iTestingId) - { - $oTest->ShowVersionsTestingTable($this->objectMakeUrl()."&iTestingId=", 5); - } else if($oTest) /* We are previewing the version */ - { - $oTable = $oTest->CreateTestTable(); - $oTable->AddRow($oTest->CreateTestTableRow(0, "")); - echo $oTable->GetString(); + if($oTest) + { + if($oTest->iTestingId) + { + $oTest->ShowVersionsTestingTable($this->objectMakeUrl()."&iTestingId=", 5); + } else /* We are previewing the version */ + { + $oTable = $oTest->CreateTestTable(); + $oTable->AddRow($oTest->CreateTestTableRow(0, "")); + echo $oTable->GetString(); + } } if($_SESSION['current']->isLoggedIn())