Skip to content

Commit 64c1b39

Browse files
committed
Improvement to B64Extension.ToB64Url (handling of zero-length arrays/segments).
1 parent 40962ef commit 64c1b39

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Extensions/B64Extensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ public static string ToB64Url(this byte[] input)
151151

152152
static string _ToB64Url(ref ArraySegment<byte> inputSegment)
153153
{
154+
if (inputSegment.Count < 1) return string.Empty;
154155
string b64str = _ToB64(ref inputSegment);
155156
return b64str.Substring(0, b64str.Length - 1);
156157
}// _ToB64Url()

0 commit comments

Comments
 (0)