summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-06-03 17:31:16 -0400
committerMalf Furious <m@lfurio.us>2017-06-03 17:31:16 -0400
commitda90fc87384b1daa8104cdea14fb1b52f0f747b7 (patch)
tree69754416b1e236b2cfddbcecf93f3a53d06efbd8 /app
parenteb4b42f32856b0e5616b700614c8c68d77cd0ea3 (diff)
downloadscrott-da90fc87384b1daa8104cdea14fb1b52f0f747b7.tar.gz
scrott-da90fc87384b1daa8104cdea14fb1b52f0f747b7.zip
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.
Diffstat (limited to 'app')
-rw-r--r--app/class/issue.class.php7
1 files changed, 6 insertions, 1 deletions
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);
}
}