From da90fc87384b1daa8104cdea14fb1b52f0f747b7 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 3 Jun 2017 17:31:16 -0400 Subject: issue: Fix bug in functions advance() and close() If the issue is already closed, these functions should do nothing. Continuing the logic in these functions could currupt the database. --- app/class/issue.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/class/issue.class.php b/app/class/issue.class.php index 1286e1a..3127a87 100644 --- a/app/class/issue.class.php +++ b/app/class/issue.class.php @@ -98,6 +98,9 @@ class issue extends object { $stage = $this->getParent(); + if ($stage->objtype != "stage") + return; + if (!($next = $stage->getNext())) $this->close(); else @@ -110,7 +113,9 @@ class issue extends object public function close() : void { $pad = $this->getParent()->getParent(); - $this->setParent($pad); + + if ($pad) + $this->setParent($pad); } } -- cgit v1.2.3