From fc1645eaf5176b95318e7be8f9f622d065c577ee Mon Sep 17 00:00:00 2001 From: DariusIII Date: Sun, 13 Aug 2017 19:06:01 +0200 Subject: [PATCH] Slightly improve the getById function --- nntmux/Users.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nntmux/Users.php b/nntmux/Users.php index 41a37d08c..e336a0598 100755 --- a/nntmux/Users.php +++ b/nntmux/Users.php @@ -590,7 +590,7 @@ class Users /** * @param $id * - * @return mixed + * @return array|bool */ public function getById($id) { @@ -599,6 +599,10 @@ class Users $result = $this->pdo->query($sql, true, NN_CACHE_EXPIRY_MEDIUM); + if (empty($result)) { + return false; + } + return $result[0]; }