Skip to content

Commit

Permalink
Fixed a small crash in XAuth when credentials were incorrect.
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenTao authored and GoldenTao committed Aug 8, 2011
1 parent d84d586 commit 5ef2a0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Twitterizer2/OAuth/XAuthUtility.cs
Expand Up @@ -94,7 +94,8 @@ public static OAuthTokenResponse GetAccessTokens(string consumerKey, string cons

response.Token = Regex.Match(responseBody, @"oauth_token=([^&]+)").Groups[1].Value;
response.TokenSecret = Regex.Match(responseBody, @"oauth_token_secret=([^&]+)").Groups[1].Value;
response.UserId = long.Parse(Regex.Match(responseBody, @"user_id=([^&]+)").Groups[1].Value, CultureInfo.CurrentCulture);
if (responseBody.Contains("user_id="))
response.UserId = long.Parse(Regex.Match(responseBody, @"user_id=([^&]+)").Groups[1].Value, CultureInfo.CurrentCulture);
response.ScreenName = Regex.Match(responseBody, @"screen_name=([^&]+)").Groups[1].Value;
}
catch (WebException wex)
Expand Down

0 comments on commit 5ef2a0e

Please sign in to comment.