From: defacer Date: Fri, 25 Jun 2004 07:01:08 +0000 (+0000) Subject: Improved error handling a bit. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f184e8311f8c07d4994298dd881de0d311e3618f;p=moodle.git Improved error handling a bit. --- diff --git a/admin/blocks.php b/admin/blocks.php index 916ccafe26..95d5947e9b 100644 --- a/admin/blocks.php +++ b/admin/blocks.php @@ -105,7 +105,7 @@ /// Get and sort the existing blocks - if (!$blocks = get_records('blocks')) { + if (false === ($blocks = get_records('blocks'))) { error('No blocks found!'); // Should never happen } @@ -117,6 +117,11 @@ $blockbyname[$blockobject->get_title()] = $block->id; $blockobjects[$block->id] = $blockobject; } + + if(empty($blockbyname)) { + error('One or more blocks are registered in the database, but they all failed to load!'); + } + ksort($blockbyname); /// Print the table of all blocks