summaryrefslogtreecommitdiff
path: root/includes/model/Room_model.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-01-14 23:07:34 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2018-01-14 23:07:34 +0100
commit0d154365a23678c138cadad31f746aa27ac3f96a (patch)
tree059a22951a20bd85e2acfbda68fee8899bed0fe0 /includes/model/Room_model.php
parent646ffc19107999a1cdcd1c897fbb6d28d520bb13 (diff)
models: return null on empty result
Diffstat (limited to 'includes/model/Room_model.php')
-rw-r--r--includes/model/Room_model.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/model/Room_model.php b/includes/model/Room_model.php
index 36a375aa..b29f68fe 100644
--- a/includes/model/Room_model.php
+++ b/includes/model/Room_model.php
@@ -148,14 +148,16 @@ function Room_update($room_id, $name, $from_frab, $map_url, $description)
* Returns room by id.
*
* @param int $room_id RID
- * @return array
+ * @return array|null
*/
function Room($room_id)
{
- return DB::selectOne('
+ $room = DB::selectOne('
SELECT *
FROM `Room`
WHERE `RID` = ?', [
$room_id
]);
+
+ return empty($room) ? null : $room;
}