GoogleCodeArchive / msnp-sharp

Automatically exported from code.google.com/p/msnp-sharp
0 stars 0 forks source link

NullReference Exception when execute Messenger.Disconnect during GetContactCard #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I get a NullReference Exception when I try to disconnect from messenger
while there is another thread getting the contact card.

I have attached a screenshot.

Original issue reported on code.google.com by johnpaul...@gmail.com on 24 Mar 2009 at 7:10

Attachments:

GoogleCodeExporter commented 9 years ago
here is the fix:

                            if (NSMessageHandler.ContactService.Deltas != null)
                            {
                                if
(NSMessageHandler.ContactService.Deltas.DynamicItems.ContainsKey(account))
                                {
                                    BaseDynamicItemType basedyItem =
NSMessageHandler.ContactService.Deltas.DynamicItems[account];
                                    if (basedyItem is PassportDynamicItem)
                                    {
                                        PassportDynamicItem psDyItem = basedyItem as
PassportDynamicItem;

                                        psDyItem.ProfileGleamSpecified = true;
                                        psDyItem.ProfileGleam = false;

                                        psDyItem.SpaceGleamSpecified = true;
                                        psDyItem.SpaceGleam = false;

                                        if (psDyItem.SpaceStatus == "Exist Access" ||
psDyItem.ProfileStatus == "Exist Access")
                                        {
                                            NSMessageHandler.ContactList[account,
ClientType.PassportMember].DynamicChanged = DynamicItemState.None;

NSMessageHandler.ContactService.Deltas.DynamicItems.Remove(account);
                                        }

                                        NSMessageHandler.ContactService.Deltas.Save();
                                    }
                                }
                            }

Original comment by johnpaul...@gmail.com on 24 Mar 2009 at 7:13

GoogleCodeExporter commented 9 years ago
Thanks reporting.
Fixed.

Original comment by freezing...@gmail.com on 25 Mar 2009 at 4:02

GoogleCodeExporter commented 9 years ago

Original comment by hepha...@gmail.com on 3 Apr 2009 at 8:48