Skip to content

Commit

Permalink
MDL-83044 core_blocks: Add return value check
Browse files Browse the repository at this point in the history
  • Loading branch information
Fragonite committed Sep 8, 2024
1 parent 1938c43 commit 4eb989f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions blocks/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,11 @@ public function process_dynamic_submission() {
$blockregion = $this->optional_param('blockregion', null, PARAM_TEXT);
$newblock = $this->page->blocks->add_block_at_end_of_default_region($this->block->name(),
empty($blockregion) ? null : $blockregion);

if (empty($newblock)) {
return;
}

$this->page->blocks->load_blocks();
$newblock = $this->page->blocks->find_instance($newblock->instance->id);
$newdata = $this->prepare_defaults($newblock->instance);
Expand Down

0 comments on commit 4eb989f

Please sign in to comment.