From f184e8311f8c07d4994298dd881de0d311e3618f Mon Sep 17 00:00:00 2001 From: defacer Date: Fri, 25 Jun 2004 07:01:08 +0000 Subject: [PATCH] Improved error handling a bit. --- admin/blocks.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.39.5