From 7785fbf8b70f70ad644d46993324e77d9a672852 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Wed, 6 Nov 2013 14:47:25 +0100 Subject: [PATCH] [FIX] Settings return value on empty result --- public/include/classes/setting.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/include/classes/setting.class.php b/public/include/classes/setting.class.php index fdf75df9..56944638 100644 --- a/public/include/classes/setting.class.php +++ b/public/include/classes/setting.class.php @@ -14,7 +14,8 @@ class Setting extends Base { public function getValue($name) { $stmt = $this->mysqli->prepare("SELECT value FROM $this->table WHERE name = ? LIMIT 1"); if ($this->checkStmt($stmt) && $stmt->bind_param('s', $name) && $stmt->execute() && $result = $stmt->get_result()) - return $result->fetch_object()->value; + if ($result->num_rows > 0) + return $result->fetch_object()->value; return $this->sqlError(); }