diff --git a/js/models/messages.js b/js/models/messages.js
index 16c13167b1..cf3b021fbb 100644
--- a/js/models/messages.js
+++ b/js/models/messages.js
@@ -199,13 +199,15 @@
fromContact.isMe = true;
}
- const conversation = this.getConversation();
- let to = this.findAndFormatContact(conversation.get('id'));
- if (conversation.isMe()) {
+ const convo = this.getConversation();
+
+ let to = convo ? this.findAndFormatContact(convo.get('id')) : {};
+
+ if (convo && convo.isMe()) {
to.isMe = true;
} else if (
- sourceE164 === conversation.get('e164') ||
- sourceUuid === conversation.get('uuid')
+ (sourceE164 && convo && sourceE164 === convo.get('e164')) ||
+ (sourceUuid && convo && sourceUuid === convo.get('uuid'))
) {
to = {
isMe: true,
@@ -213,7 +215,7 @@
}
return {
- from: fromContact,
+ from: fromContact || {},
to,
isSelected: this.isSelected,
diff --git a/ts/components/MessageSearchResult.md b/ts/components/MessageSearchResult.md
index 1ad50030e7..3829ad7053 100644
--- a/ts/components/MessageSearchResult.md
+++ b/ts/components/MessageSearchResult.md
@@ -230,3 +230,20 @@
/>
```
+
+#### Empty
+
+```jsx
+
+ console.log('onClick', result)}
+ i18n={util.i18n}
+ />
+
+```
diff --git a/ts/components/conversation/ContactName.tsx b/ts/components/conversation/ContactName.tsx
index 1a88c146cc..2e82a7bb83 100644
--- a/ts/components/conversation/ContactName.tsx
+++ b/ts/components/conversation/ContactName.tsx
@@ -24,7 +24,7 @@ export class ContactName extends React.Component {
return (
-
+
{shouldShowProfile ? ' ' : null}
{profileElement}