From d0747b9f7b9bcf2606055b5709ab7ccc064347ad Mon Sep 17 00:00:00 2001 From: or-else Date: Wed, 16 May 2018 11:55:48 -0700 Subject: [PATCH] bug: topic may not be ready yet --- index.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index d5cedf33..6cd50536 100644 --- a/index.html +++ b/index.html @@ -2585,11 +2585,14 @@ var newState = {contactList: []}; if (topic.getType() === "p2p") { // Fetch the other party in the p2p conversation. + // Topic may not be ready yet, so check if user is found. var user2 = topic.subscriber(props.topic); - newState.modeGiven2 = user2.acs.getGiven(); - newState.modeWant2 = user2.acs.getWant(); + if (user2) { + newState.modeGiven2 = user2.acs.getGiven(); + newState.modeWant2 = user2.acs.getWant(); + } } else { - topic.subscribers(function(sub){ + topic.subscribers(function(sub) { newState.contactList.push(sub); }, this); }