 
         let key = message.messageID
 
-        if let messageHeight = messageHeights[key] {
-            return messageHeight
+        if !key.isEmpty {
+            if let messageHeight = messageHeights[key] {
+                return messageHeight
+            }
         }
 
         var height: CGFloat = 0


                let height = heightOfMessage(message) + 10 // TODO: +10 cell line space

                newMessagesTotalHeight += height
            }
            

            height = max(ceil(rect.height) + (11 * 2), YepConfig.chatCellAvatarSize())
        }

        if !key.isEmpty {
            messageHeights[key] = height
        }

        return height
    }
