Permalink
Browse files

better handle exceptions with no response (by bubbling them up)

  • Loading branch information...
1 parent 4c63202 commit 11e422e289f7d538cd029a51f87f693a0443e1e9 @smarx committed Aug 9, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 LeaseExtensions.cs
View
@@ -14,7 +14,7 @@ public static string TryAcquireLease(this CloudBlob blob)
try { return blob.AcquireLease(); }
catch (WebException e)
{
- if (((HttpWebResponse)e.Response).StatusCode != HttpStatusCode.Conflict) // 409, already leased
+ if ((e.Response == null) || ((HttpWebResponse)e.Response).StatusCode != HttpStatusCode.Conflict) // 409, already leased
{
throw;
}

0 comments on commit 11e422e

Please sign in to comment.