]> git.mjollnir.org Git - moodle.git/commitdiff
Added some checking that should not be necessary but I had notices in one extreme...
authormoodler <moodler>
Wed, 13 Sep 2006 08:09:18 +0000 (08:09 +0000)
committermoodler <moodler>
Wed, 13 Sep 2006 08:09:18 +0000 (08:09 +0000)
lib/dmllib.php

index ae4d50a61e68c505fc002ca515ed19c4f0f9f5e4..da36bc89d684373b4a0a205ccffcf5ca7adf3337 100644 (file)
@@ -593,6 +593,10 @@ function get_recordset_sql($sql, $limitfrom=null, $limitnum=null) {
 
     global $CFG, $db;
 
+    if (empty($db)) {
+        return false;
+    }
+
     if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; };
 
     if ($limitfrom || $limitnum) {
@@ -994,6 +998,10 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
 
     global $db, $CFG, $empty_rs_cache;
 
+    if (empty($db)) {
+        return false;
+    }
+
 /// DIRTY HACK: Implement one cache to store meta data (needed by Oracle inserts)
 /// TODO: Possibly make it global to benefit other functions needing it (update_record...)
     if (!isset($metadatacache)) {