Skip to content

Commit 3c2a5d1

Browse files
committed
Improved SafeCompare.
1 parent 064f404 commit 3c2a5d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JsonLD/Util/JavaCompat.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static bool SafeCompare<T>(this JToken token, T val)
6767
{
6868
try
6969
{
70-
return token.Value<T>().Equals(val);
70+
return token == null ? val == null : token.Value<T>().Equals(val);
7171
}
7272
catch
7373
{

0 commit comments

Comments
 (0)