Skip to content

Commit

Permalink
Fix #132 - get $file before trying to check it.
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden committed May 1, 2024
1 parent 1243d4c commit 1e385a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 1e385a8

Please sign in to comment.