Skip to content

Commit

Permalink
Merge branch 'MDL-74269-master' of https://github.com/ericmerrill/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Mar 21, 2022
2 parents 8a8001f + dd54065 commit 6d8bb89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/db/upgrade.php
Expand Up @@ -2764,7 +2764,7 @@ function xmldb_main_upgrade($oldversion) {
// Set the description field to HTML format for the Default course category.
$category = $DB->get_record('course_categories', ['id' => 1]);

if ($category->descriptionformat == FORMAT_MOODLE) {
if (!empty($category) && $category->descriptionformat == FORMAT_MOODLE) {
// Format should be changed only if it's still set to FORMAT_MOODLE.
if (!is_null($category->description)) {
// If description is not empty, format the content to HTML.
Expand Down

0 comments on commit 6d8bb89

Please sign in to comment.