diff --git a/locallib.php b/locallib.php index b12ae52..2d74f2e 100755 --- a/locallib.php +++ b/locallib.php @@ -1596,11 +1596,14 @@ function game_snakes_create_user_defined_board( &$game) require("snakes/createboard.php"); $fs = get_file_storage(); $files = $fs->get_area_files($modcontext->id, 'mod_game', 'snakes_file', $game->id); + $f = false; foreach ($files as $f) { if( $f->is_directory()) continue; break; } + if( $f === false) + print_error( 'No image specified'); $im=game_createsnakesboard($f->get_content(), $board->cols, $board->rows, $board->headery, $board->headery, $board->footerx, $board->headerx, $board->data, $board->width, $board->height); ob_start(); imagepng($im); diff --git a/version.php b/version.php index 9d9f79c..6d65596 100755 --- a/version.php +++ b/version.php @@ -11,7 +11,7 @@ defined('MOODLE_INTERNAL') || die(); $module->component = 'mod_game'; // Full name of the plugin (used for diagnostics) -$module->version = 2013012703; // The current module version (Date: YYYYMMDDXX) +$module->version = 2013012704; // The current module version (Date: YYYYMMDDXX) $module->requires = 2010112400; // Requires Moodle 2.0 $module->cron = 0; // Period for cron to check this module (secs) -$module->release = 'v.2.13.27 (2013012703)'; +$module->release = 'v.2.13.27 (2013012704)';