Bug 955654 - Error: (intermediate value).buddy is null at ibConvStatsService.js:479, r=florian.
authoraleth <aleth@instantbird.org>
Sat, 16 Nov 2013 14:37:41 -0500
changeset 19239 bf9bc8d8d719d6865e8ba7169909a5c89fef95a4
parent 19238 f23b0a32906539643147c161b4e381b9184b410e
child 19240 d4e6e230a882948b37b3adaf1181d2a59380cde3
push id1103
push usermbanner@mozilla.com
push dateTue, 18 Mar 2014 07:44:06 +0000
treeherdercomm-beta@50c6279a0af0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs955654
Bug 955654 - Error: (intermediate value).buddy is null at ibConvStatsService.js:479, r=florian.
im/components/ibConvStatsService.js
--- a/im/components/ibConvStatsService.js
+++ b/im/components/ibConvStatsService.js
@@ -482,23 +482,23 @@ ConvStatsService.prototype = {
       let conv = aSubject;
       let id = getConversationId(conv.account.protocol.normalizedName,
                                  conv.account.name, conv.normalizedName, conv.isChat);
       if (!(id in gStatsByConvId))
         gStatsByConvId[id] = new ConversationStats(id);
       this._statsByPrplConvId.set(conv.id, gStatsByConvId[id]);
 
       let possibleConv = null;
-      if (!conv.isChat) {
+      if (conv.buddy) {
         // First .buddy is an imIAccountBuddy, second one is an imIBuddy.
         let contact = conv.buddy.buddy.contact;
         if (contact)
           possibleConv = this._contactsById.get(contact.id);
       }
-      else {
+      else if (conv.isChat) {
         let chatList = this._chatsByAccountIdAndName.get(conv.account.id);
         if (chatList && chatList.has(conv.normalizedName))
           possibleConv = chatList.get(conv.name);
       }
       this._convsByPrplConvId.set(conv.id, possibleConv);
     }
     else if (aTopic == "conversation-closed")
       this._statsByPrplConvId.delete(aSubject.id);