MDL-65104 registration: Ensure $registration is always null when no record exists

This commit is contained in:
Cameron Ball
2019-03-21 16:12:30 +08:00
parent f3ad037584
commit 3282dda765
+2 -2
View File
@@ -80,7 +80,7 @@ class registration {
global $DB;
if (self::$registration === null) {
self::$registration = $DB->get_record('registration_hubs', ['huburl' => HUB_MOODLEORGHUBURL]);
self::$registration = $DB->get_record('registration_hubs', ['huburl' => HUB_MOODLEORGHUBURL]) ?: null;
}
if (self::$registration && (bool)self::$registration->confirmed == (bool)$confirmed) {
@@ -569,4 +569,4 @@ class registration {
redirect(new moodle_url('/admin/registration/index.php', ['returnurl' => $returnurl->out_as_local_url(false)]));
}
}
}
}