Unverified Commit 35edefe7 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(management) Avoid calling update on NULL

Management dialogs tend to close themselves from readPost method, so
 after calling readPost we need to check the dialog is still there before
 calling update.

issue #6072
Showing with 8 additions and 3 deletions
+8 -3
......@@ -506,7 +506,12 @@ class management implements FusionDirectoryDialog
} elseif (is_object($this->dialogObject)) {
try {
$this->dialogObject->readPost();
$this->dialogObject->update();
if (is_object($this->dialogObject)) {
/* Check again as readPost might close it */
if (!$this->dialogObject->update()) {
$this->closeDialogs();
}
}
} catch (FusionDirectoryException $e) {
$error = new FusionDirectoryError(htmlescape($e->getMessage()), 0, $e);
$error->display();
......
......@@ -96,7 +96,7 @@ class templateDialog implements FusionDirectoryDialog
public function update(): bool
{
return TRUE;
return !$this->closed;
}
function setNextTarget ($target)
......@@ -131,6 +131,6 @@ class templateDialog implements FusionDirectoryDialog
protected function handleCancel ()
{
$this->management->remove_lock();
$this->management->closeDialogs();
$this->closed = TRUE;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment