diff --git a/lib.php b/lib.php index da97b11..a559598 100644 --- a/lib.php +++ b/lib.php @@ -451,7 +451,8 @@ function dialogue_pluginfile($course, $cm, $context, $filearea, $args, $forcedow $fs = get_file_storage(); $relativepath = implode('/', $args); $fullpath = "/$context->id/mod_dialogue/$filearea/$itemid/$relativepath"; - if (!$file = $fs->get_file_by_hash(sha1($fullpath)) || $file->is_directory()) { + $file = $fs->get_file_by_hash(sha1($fullpath)); + if (!$file || $file->is_directory()) { return false; }