diff options
Diffstat (limited to 'src/ProtocolBuffers/ByteString.cs')
-rw-r--r-- | src/ProtocolBuffers/ByteString.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ProtocolBuffers/ByteString.cs b/src/ProtocolBuffers/ByteString.cs index 8b7bd06c..434865b7 100644 --- a/src/ProtocolBuffers/ByteString.cs +++ b/src/ProtocolBuffers/ByteString.cs @@ -129,7 +129,9 @@ namespace Google.ProtocolBuffers /// </summary>
public static ByteString FromBase64(string bytes)
{
- return new ByteString(Convert.FromBase64String(bytes));
+ // By handling the empty string explicitly, we not only optimize but we fix a
+ // problem on CF 2.0. See issue 61 for details.
+ return bytes == "" ? Empty : new ByteString(Convert.FromBase64String(bytes));
}
/// <summary>
|