From: Chuck Hagenbuch Date: Fri, 26 Jan 2001 20:07:22 +0000 (+0000) Subject: have DB::isError return true if passed "null". Now you can more consistently X-Git-Tag: php-4.0.5RC1~462 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4378dcf80153d66caef456b451ebbf1fd82ee72;p=php 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. --- 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)); } /**