From e7e49f6cdd6917825564880ba63f4bd3435d219e Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Thu, 21 Apr 2022 10:59:52 +0000
Subject: [PATCH] hide geo coordiantes when room has no building, fixes #945

Closes #945
---
 app/controllers/resources/room.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/app/controllers/resources/room.php b/app/controllers/resources/room.php
index 01af12eda85..1e710e8310c 100644
--- a/app/controllers/resources/room.php
+++ b/app/controllers/resources/room.php
@@ -164,7 +164,12 @@ class Resources_RoomController extends AuthenticatedController
         $this->grouped_properties = $this->room->getGroupedProperties(
             $this->room->getRequiredPropertyNames()
         );
-        $this->geo_coordinates_object = $this->room->building->getPropertyObject('geo_coordinates');
+
+        if ($this->room->building) {
+            $this->geo_coordinates_object = $this->room->building->getPropertyObject('geo_coordinates');
+        } else {
+            $this->geo_coordinates_object = null;
+        }
     }
 
 
-- 
GitLab