danielcrenna/hammock — Issue #58: NullReferenceException in RestClient.CompleteWithQuery<T>()
Author: mabster
Created: 2011-12-21 00:49:50+00:00
State: open

Hi Daniel,

Since updating my Twitter client (Halfwit) to the latest version of Hammock and TweetSharp, I'm getting a NullReferenceException every couple of days. Here's a partial stack trace:

at Hammock.RestClient.CompleteWithQuery[T](RestRequest request, WebQuery query, RestCallback`1 callback, RestResponse`1 response, WebQueryAsyncResult result)
at Hammock.RestClient.CompleteWithQuery[T](WebQuery query, RestRequest request, RestCallback`1 callback, WebQueryAsyncResult result)
at Hammock.RestClient.<>c__DisplayClass2e`1.b__2b(Object sender, WebQueryResponseEventArgs args)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Hammock.Web.WebQuery.OnQueryResponse(WebQueryResponseEventArgs args)
at Hammock.Web.WebQuery.HandleWebException(WebException exception)
at Hammock.Web.WebQuery.GetAsyncResponseCallback(IAsyncResult asyncResult)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)

It seems that the "result" parameter is null under certain conditions. Can you help?

Cheers,
Matt