From 193a41cb9d0703a5545aff269ea5a1f923694eba Mon Sep 17 00:00:00 2001
From: Jake Taylor <jake@elixxir.io>
Date: Wed, 15 Mar 2023 12:39:27 -0500
Subject: [PATCH] fix segfault in channels impl eventmodel

---
 channels/storage/impl.go | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/channels/storage/impl.go b/channels/storage/impl.go
index 45cd2724b..de2f38b01 100644
--- a/channels/storage/impl.go
+++ b/channels/storage/impl.go
@@ -131,10 +131,12 @@ func (i *impl) UpdateFromUUID(uuid uint64, messageID *message.ID, timestamp *tim
 	parentErr := errors.New("failed to UpdateFromMessageID")
 
 	msgToUpdate := &Message{
-		Id:        uuid,
-		MessageId: messageID.Marshal(),
-		Hidden:    hidden,
-		Pinned:    pinned,
+		Id:     uuid,
+		Hidden: hidden,
+		Pinned: pinned,
+	}
+	if messageID != nil {
+		msgToUpdate.MessageId = messageID.Marshal()
 	}
 	if round != nil {
 		msgToUpdate.Round = uint64(round.ID)
-- 
GitLab