]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13944 rs_close() does not throw fatal error if rs does not exist aynmore; merged...
authorskodak <skodak>
Sun, 16 Mar 2008 22:08:14 +0000 (22:08 +0000)
committerskodak <skodak>
Sun, 16 Mar 2008 22:08:14 +0000 (22:08 +0000)
lib/dmllib.php

index 739bce243b6b90ea73610ccda14d131aa033835b..25861e11af86b0a446515d328993f4d142aec747 100644 (file)
@@ -853,8 +853,13 @@ function rs_EOF($rs) {
  * Note that, once closed, the recordset must not be used anymore along the request.
  * Saves memory (optional but recommended).
  * @param ADORecordSet the recordset to be closed
+ * @return void
  */
 function rs_close(&$rs) {
+    if (!$rs) {
+        // recordset not open, hmmm
+        return;
+    }
 
     $rs->Close();
 }