Skip to content

Commit

Permalink
fix nre - Inumedia#109
Browse files Browse the repository at this point in the history
  • Loading branch information
koderhari committed Nov 1, 2017
1 parent 7eb0da4 commit b338657
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion SlackAPI/Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,21 @@ internal void GotResponse(IAsyncResult result)
catch (WebException we)
{
// If we don't get a response, let the exception bubble up as we can't do anything
if (we.Response == null) throw we;
if (we.Response == null)
{
var defaultResponse = default(K);
defaultResponse.ok = false;
defaultResponse.error = we.ToString();
if (callback != null)
callback(defaultResponse);
return;
}

//Anything that doesn't return error 200 throws an exception. Sucks. :l
response = (HttpWebResponse)we.Response;
//TODO: Handle timeouts, etc?
}


K responseObj;

Expand Down

0 comments on commit b338657

Please # to comment.