TReKiE / msnp-sharp

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

ArgumentNullException in XMLContactList.Merge(FindMembershipResultType findMembership) #121

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. User simply signs in.
2.

What is the expected output? What do you see instead?
(See below)

What version of the product are you using? (MSNPSharp, OS, Mono etc.)
  MSNPSharp, latest code on /branches/MSNPSHARP_25_STABLE
  OS Version(From OS): Microsoft Windows NT 6.0.6002 Service Pack 2
  Processor: X86

Please provide any additional information below.
Thanks for a great piece of software.  We've been seeing an
ArgumentNullException in the Merge(ABFindAllResultType forwardList) method
for a few users.   On further inspection of detailed log information that
we recieve, we find other warnings and information that suggests that each
one of these users is on a *very* flakey (probably wireless) connection,
and that connection is constantly dropping and re-establishing.  We were
never able to reproduce the problem.  :-(  But as you can see from the
stack trace, it's happening when a new element is inserted in a Dictionary.
 I looked through the Merge() code and found a few of these inserts.  I
eliminated any inserts in which it was never possible for the index to be
null (initialize in the constructor of the object, etc).  the only one that
I couldn't account for was this:

if (pdi.SpaceGleam || pdi.ProfileGleam)
{
    NSMessageHandler.ContactService.Deltas.DynamicItems[pdi.PassportName] =
dyItem;
}

Is it possible that the flakey connection is causing the webservice data to
be munged so badly that the pdi.PassportName is being passed in as a null?

I have surrounded the code in a null check of pdi.PassportName, and asked
the user to try the fix.  However, I wanted to let you devs know, in case
that quick fix will cause further problems in other places.

If you need more info, just ask.  Happy to provide it if I can.
Thanks!

Original issue reported on code.google.com by ecox.met...@gmail.com on 3 Jul 2009 at 2:50

GoogleCodeExporter commented 9 years ago
Hi,
Could you please provide us some stack trace info?

Original comment by freezing...@gmail.com on 5 Jul 2009 at 5:40

GoogleCodeExporter commented 9 years ago
Ah drat - sorry man, I thought I had it attached.  It is below.  The good news 
is, I
tried and emergency patch for a couple users and they verified that it's the
exception is thrown in the code that I posted before.  Hopefully that will help 
keep
you from having to look through tons of code to find the problem.

Thanks for looking into it

----- Main Exception -----
Class: System.ArgumentNullException
Message: Value cannot be null.
Parameter name: key
StackTrace:    at 
System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument
argument)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at MSNPSharp.IO.XMLContactList.Merge(ABFindAllResultType forwardList)
   at MSNPSharp.ContactService.<>c__DisplayClass10.<abRequest>b__d(Object sender,
ABFindAllCompletedEventArgs e)
   at
MSNPSharp.MSNWS.MSNABSharingService.ABServiceBinding.OnABFindAllOperationComplet
ed(Object
arg)
Data: 

Original comment by ecox.met...@gmail.com on 6 Jul 2009 at 5:44

GoogleCodeExporter commented 9 years ago

Original comment by hepha...@gmail.com on 6 Jul 2009 at 6:30