summary refs log tree commit diff
path: root/webclient/home/home-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'webclient/home/home-controller.js')
-rw-r--r--webclient/home/home-controller.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/webclient/home/home-controller.js b/webclient/home/home-controller.js
index 3be7fca909..f0c2ccea2f 100644
--- a/webclient/home/home-controller.js
+++ b/webclient/home/home-controller.js
@@ -86,7 +86,9 @@ angular.module('HomeController', ['matrixService', 'mFileInput', 'mFileUpload',
                     $scope.rooms[data[i].room_id] = data[i];
 
                     // Create a shortcut for the last message of this room
-                    $scope.rooms[data[i].room_id].lastMsg = data[i].messages.chunk[0];
+                    if (data[i].messages && data[i].messages.chunk && data[i].messages.chunk[0]) {
+                        $scope.rooms[data[i].room_id].lastMsg = data[i].messages.chunk[0];
+                    }
                 }
 
                 var presence = response.data.presence;