MDL-64314 messaging: Quick fix for empty insights configuration.

This commit is contained in:
Adrian Greeve 2019-02-18 16:30:19 +01:00
parent 33f070f1f6
commit 6d6a83e91d

View File

@ -2721,8 +2721,10 @@ function xmldb_main_upgrade($oldversion) {
if ($oldversion < 2019021500.01) {
$insights = $DB->get_record('message_providers', ['component' => 'moodle', 'name' => 'insights']);
$insights->capability = null;
$DB->update_record('message_providers', $insights);
if (!empty($insights)) {
$insights->capability = null;
$DB->update_record('message_providers', $insights);
}
upgrade_main_savepoint(true, 2019021500.01);
}