From 6f302bdc9814fe10bf19ea45312a8d3c113aabaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Fri, 27 Apr 2007 00:13:28 +0000 Subject: [PATCH] application_queue, only delete version if it exists. application_queue::delete() should check that the version object exists because when moving a duplicate application is deleted before the application --- include/application_queue.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/application_queue.php b/include/application_queue.php index f37a004..a47edd1 100644 --- a/include/application_queue.php +++ b/include/application_queue.php @@ -120,8 +120,14 @@ class application_queue if(!$this->oApp->delete()) $bSuccess = FALSE; - if(!$this->oVersionQueue->delete()) - $bSuccess = FALSE; + /* When deleting a duplicate app in the application queue, the version is moved + to another app and so when application_queue::delete() is called there is + no version child to delete, so check if the versionId is valid */ + if($this->oVersionQueue->oVersion->iVersionId) + { + if(!$this->oVersionQueue->delete()) + $bSuccess = FALSE; + } return $bSuccess; }