Fixes filter on undefined
@@ -165,9 +165,10 @@ function genComponentConf() {
isWhatsAroundNeed(this.ownedNeed) || isWhatsNewNeed(this.ownedNeed);
const nonOwnedNeedUri = get(connection, "remoteNeedUri");
const nonOwnedNeed = getIn(state, ["needs", nonOwnedNeedUri]);
- const chatMessages = get(connection, "messages").filter(
- msg => !msg.getIn(["references", "forwards"])
- ); //FILTER OUT ALL FORWARD MESSAGES JUST IN CASE
+ const allChatMessages = get(connection, "messages");
+ const chatMessages =
+ allChatMessages &&
+ allChatMessages.filter(msg => !msg.getIn(["references", "forwards"])); //FILTER OUT ALL FORWARD MESSAGES JUST IN CASE
const hasConnectionMessagesToLoad = hasMessagesToLoad(
state,
connectionUri
