diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 703f2fac9a916992693ca9370ed1a9144eaa5362..7bbb803bc7bd66fbff10d859eb0075da7802fe8a 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -138,7 +138,7 @@ Item {
         spacing: Nheko.paddingLarge
 
         Avatar {
-            url: room.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
+            url: room ? room.roomAvatarUrl.replace("mxc://", "image://MxcImage/") : ""
             displayName: room ? room.roomName : ""
             height: 130
             width: 130