Permalink
Browse files

Fixed bug that errors in http communication are not propagated correc…

…tly if response is empty.
  • Loading branch information...
oliverhanappi committed Feb 20, 2012
1 parent 5766bf7 commit 287c9f0187c559ed466afa69ca77dae72ed6801a
Showing with 3 additions and 1 deletion.
  1. +3 −1 RestSharp/Extensions/MiscExtensions.cs
@@ -106,7 +106,9 @@ public static string AsString(this JToken token, CultureInfo culture)
/// <param name="buffer">An array of bytes to convert</param>
/// <returns>The byte as a string.</returns>
public static string AsString(this byte[] buffer)
- {
+ {
+ if (buffer == null) return "";
+
// Ansi as default
Encoding encoding = Encoding.UTF8;

0 comments on commit 287c9f0

Please sign in to comment.