From daba31339ed1779228ffe1292090a622a5c5f6ff Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 6 Jul 2016 16:19:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BModel=E7=B1=BB=E7=9A=84=5F=5F?= =?UTF-8?q?isset=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index 8e4498dd..51f86541 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1294,13 +1294,18 @@ abstract class Model implements \JsonSerializable, \ArrayAccess */ public function __isset($name) { - if (array_key_exists($name, $this->data)) { - return true; - } elseif ($this->getAttr($name)) { - return true; - } else { + try { + if (array_key_exists($name, $this->data)) { + return true; + } elseif ($this->getAttr($name)) { + return true; + } else { + return false; + } + } catch (InvalidArgumentException $e) { return false; } + } /**