Skip to content

Commit

Permalink
Return "<null>" for Slice.Nil with formatter K or V instead of empty …
Browse files Browse the repository at this point in the history
…string

- Helps see the actual missing value when used in log messages
  • Loading branch information
KrzysFR committed May 26, 2020
1 parent 40adc1e commit 4857fe9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions FoundationDB.Client/Shared/Memory/Slice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1991,11 +1991,11 @@ public string ToString(string? format, IFormatProvider? provider)

case "K":
case "k":
return PrettyPrint(); //TODO: Key ! (cf USlice)
return this.IsNull ? "<null>" : PrettyPrint(); //TODO: Key ! (cf USlice)

case "V":
case "v":
return PrettyPrint(); //TODO: Value ! (cf USlice)
return this.IsNull ? "<null>" : PrettyPrint(); //TODO: Value ! (cf USlice)

default:
throw new FormatException("Format is invalid or not supported");
Expand Down

0 comments on commit 4857fe9

Please sign in to comment.