aboutsummaryrefslogtreecommitdiff
path: root/ui/widget
diff options
context:
space:
mode:
Diffstat (limited to 'ui/widget')
-rw-r--r--ui/widget/room-view.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/widget/room-view.go b/ui/widget/room-view.go
index 69216fb..2e82a2d 100644
--- a/ui/widget/room-view.go
+++ b/ui/widget/room-view.go
@@ -251,7 +251,10 @@ func (view *RoomView) NewMessage(id, sender, msgtype, text string, timestamp tim
func (view *RoomView) NewTempMessage(msgtype, text string) *types.Message {
now := time.Now()
id := strconv.FormatInt(now.UnixNano(), 10)
- sender := view.Room.GetSessionOwner().DisplayName
+ sender := ""
+ if ownerMember := view.Room.GetSessionOwner(); ownerMember != nil {
+ sender = ownerMember.DisplayName
+ }
message := view.NewMessage(id, sender, msgtype, text, now)
message.State = types.MessageStateSending
view.AddMessage(message, AppendMessage)