]> git.mjollnir.org Git - moodle.git/commitdiff
Improved error handling a bit.
authordefacer <defacer>
Fri, 25 Jun 2004 07:01:08 +0000 (07:01 +0000)
committerdefacer <defacer>
Fri, 25 Jun 2004 07:01:08 +0000 (07:01 +0000)
admin/blocks.php

index 916ccafe2666f3419ec93614c13471b629655899..95d5947e9b2a691c12cdc223b2c2b7021c4bbe75 100644 (file)
 
 /// Get and sort the existing blocks
 
-    if (!$blocks = get_records('blocks')) {
+    if (false === ($blocks = get_records('blocks'))) {
         error('No blocks found!');  // Should never happen
     }
 
         $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