check result is an object
authorAlan <alan@roojs.com>
Tue, 16 Nov 2021 03:25:00 +0000 (11:25 +0800)
committerAlan <alan@roojs.com>
Tue, 16 Nov 2021 03:25:00 +0000 (11:25 +0800)
DB/DataObject.php

index d998eda..1746771 100644 (file)
@@ -2867,7 +2867,7 @@ class DB_DataObject extends DB_DataObject_Overload
         if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
             $this->debug(serialize($result), 'RESULT',5);
         }
-        if (method_exists($result, 'numRows')) {
+        if (is_object($result) && method_exists($result, 'numRows')) {
             if ($_DB_driver == 'DB') {
                 $DB->expectError(DB_ERROR_UNSUPPORTED);
             } else {