diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2010-07-23 21:17:37 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2010-07-23 21:17:37 -0700 |
commit | 5fa01bf4e0678b9755a3becbc6e9136abd592320 (patch) | |
tree | 58a6930560ab79605b4cafe4ba5bcde620de137b /samples/OAuthConsumerWpf/MainWindow.xaml.cs | |
parent | 29b7875c73d20f5607896e9f35a45d0a8bae4c54 (diff) | |
download | DotNetOpenAuth-5fa01bf4e0678b9755a3becbc6e9136abd592320.zip DotNetOpenAuth-5fa01bf4e0678b9755a3becbc6e9136abd592320.tar.gz DotNetOpenAuth-5fa01bf4e0678b9755a3becbc6e9136abd592320.tar.bz2 |
Smoothing out some rough edges in OAuth code.
Diffstat (limited to 'samples/OAuthConsumerWpf/MainWindow.xaml.cs')
-rw-r--r-- | samples/OAuthConsumerWpf/MainWindow.xaml.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/samples/OAuthConsumerWpf/MainWindow.xaml.cs b/samples/OAuthConsumerWpf/MainWindow.xaml.cs index e62683d..b194777 100644 --- a/samples/OAuthConsumerWpf/MainWindow.xaml.cs +++ b/samples/OAuthConsumerWpf/MainWindow.xaml.cs @@ -233,8 +233,10 @@ MessageBox.Show(this, ex.Message); } catch (WebException ex) { string responseText = string.Empty; - using (var responseReader = new StreamReader(ex.Response.GetResponseStream())) { - responseText = responseReader.ReadToEnd(); + if (ex.Response != null) { + using (var responseReader = new StreamReader(ex.Response.GetResponseStream())) { + responseText = responseReader.ReadToEnd(); + } } MessageBox.Show(this, ex.Message + " " + responseText); } |