diff --git a/lib/weblib.php b/lib/weblib.php index dfd570402fe..73640b33c6f 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1502,7 +1502,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL static $croncache = array(); - if ($text === '') { + if ($text === '' || is_null($text)) { return ''; // no need to do any filters and cleaning }