Skip to content

Commit 287c9f0

Browse files
committed
Fixed bug that errors in http communication are not propagated correctly if response is empty.
1 parent 5766bf7 commit 287c9f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

RestSharp/Extensions/MiscExtensions.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ public static string AsString(this JToken token, CultureInfo culture)
106106
/// <param name="buffer">An array of bytes to convert</param>
107107
/// <returns>The byte as a string.</returns>
108108
public static string AsString(this byte[] buffer)
109-
{
109+
{
110+
if (buffer == null) return "";
111+
110112
// Ansi as default
111113
Encoding encoding = Encoding.UTF8;
112114

0 commit comments

Comments
 (0)