diff --git a/mod/data/locallib.php b/mod/data/locallib.php index 2cb0d2a743e..9d829635f08 100644 --- a/mod/data/locallib.php +++ b/mod/data/locallib.php @@ -348,7 +348,9 @@ class data_portfolio_caller extends portfolio_module_caller_base { $includedfiles = array(); foreach ($fields as $singlefield) { if (is_callable(array($singlefield, 'get_file'))) { - $includedfiles[] = $singlefield->get_file($record->id); + if ($file = $singlefield->get_file($record->id)) { + $includedfiles[] = $file; + } } } if (count($includedfiles) == 1 && count($fields) == 1) {