From b4378dcf80153d66caef456b451ebbf1fd82ee72 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Fri, 26 Jan 2001 20:07:22 +0000 Subject: [PATCH] have DB::isError return true if passed "null". Now you can more consistently use DB::isError(), since some of the db drivers return nulls from various functions (like fetchRow()), and others don't... We should probably make all of them just return errors. I did this for the mysql driver, as a start. --- pear/DB.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pear/DB.php b/pear/DB.php index 788aed02fc..3c706c0aac 100644 --- a/pear/DB.php +++ b/pear/DB.php @@ -242,9 +242,10 @@ class DB */ function isError($value) { - return is_object($value) && - (get_class($value) == "db_error" || - is_subclass_of($value, "db_error")); + return (is_object($value) && + (get_class($value) == "db_error" || + is_subclass_of($value, "db_error")) || + !isset($value)); } /** -- 2.50.1