Skip to content

Commit

Permalink
Bugfix when there's no partial submission found
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Erkelens committed Jun 19, 2018
1 parent 002cf17 commit b8a99ac
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/extensions/SubmittedFormExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ public function updateAfterProcess()
$partialID = Controller::curr()->getRequest()->getSession()->get(PartialUserFormController::SESSION_KEY);
/** @var PartialFormSubmission $partialForm */
$partialForm = PartialFormSubmission::get()->byID($partialID);
foreach ($partialForm->PartialFields() as $field) {
$field->delete();
$field->destroy();
if ($partialForm) {
foreach ($partialForm->PartialFields() as $field) {
$field->delete();
$field->destroy();
}
$partialForm->delete();
$partialForm->destroy();
}
$partialForm->delete();
$partialForm->destroy();
Controller::curr()->getRequest()->getSession()->clear(PartialUserFormController::SESSION_KEY);
}

Expand Down

0 comments on commit b8a99ac

Please sign in to comment.