From 4af8179e9a05ccba4d2360dde7f19b1a148827d6 Mon Sep 17 00:00:00 2001 From: Justus Dieckmann <justusdieckmann@wwu.de> Date: Tue, 19 May 2020 21:45:52 +0200 Subject: [PATCH] Check $settings-array for being null before accessing it --- step/email/lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/step/email/lib.php b/step/email/lib.php index f063d2d..b247741 100644 --- a/step/email/lib.php +++ b/step/email/lib.php @@ -269,6 +269,7 @@ class email extends libbase { * @param array $settings array containing the settings from the db. */ public function extend_add_instance_form_definition_after_data($mform, $settings) { - $mform->setDefault('contenthtml', array('text' => $settings['contenthtml'], 'format' => FORMAT_HTML)); + $mform->setDefault('contenthtml', + array('text' => isset($settings['contenthtml']) ? $settings['contenthtml'] : '', 'format' => FORMAT_HTML)); } } -- GitLab