Skip to content

Commit e65fd6e

Browse files
committed
using null-conditional operator
1 parent 5ea7bef commit e65fd6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Src/Newtonsoft.Json/JsonPosition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ internal static string FormatMessage(IJsonLineInfo? lineInfo, string path, strin
161161

162162
message += "Path '{0}'".FormatWith(CultureInfo.InvariantCulture, path);
163163

164-
if (lineInfo != null && lineInfo.HasLineInfo())
164+
if (lineInfo?.HasLineInfo())
165165
{
166166
message += ", line {0}, position {1}".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition);
167167
}

0 commit comments

Comments
 (0)