Skip to content

Commit 7ae2aca

Browse files
committed
Fix #706 Nullref exception in FSI
1 parent 3190096 commit 7ae2aca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/sformat.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ namespace Microsoft.FSharp.Text.StructuredFormat
11941194
| :? bool as b -> (if b then "true" else "false")
11951195
| :? char as c -> "\'" + formatChar true c + "\'"
11961196
| _ -> try let text = obj.ToString()
1197-
text
1197+
if text = null then "" else text
11981198
with e ->
11991199
// If a .ToString() call throws an exception, catch it and use the message as the result.
12001200
// This may be informative, e.g. division by zero etc...

0 commit comments

Comments
 (0)