Skip to content

Commit c1396be

Browse files
committed
Removed NullReference Possibility
1 parent 1fcc617 commit c1396be

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/HotChocolate/AspNetCore/src/Transport.Abstractions/Serialization/Utf8JsonWriterHelper.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,14 @@ internal static IReadOnlyList<FileReferenceInfo> WriteFilesMap(
243243

244244
writer.WritePropertyName(name);
245245
writer.WriteStartArray();
246-
246+
247247
foreach (var path in item.Value)
248248
{
249249
writer.WriteStringValue(path.ToString(operation));
250250
}
251251

252252
writer.WriteEndArray();
253-
253+
254254
index++;
255255
}
256256

@@ -259,7 +259,7 @@ internal static IReadOnlyList<FileReferenceInfo> WriteFilesMap(
259259
return fileInfos;
260260
}
261261
}
262-
262+
263263
if (operationRequest.Variables is not null)
264264
{
265265
Dictionary<FileReference, FilePath[]>? files = null;
@@ -279,7 +279,7 @@ internal static IReadOnlyList<FileReferenceInfo> WriteFilesMap(
279279

280280
writer.WritePropertyName(name);
281281
writer.WriteStartArray();
282-
282+
283283
foreach (var path in item.Value)
284284
{
285285
writer.WriteStringValue(path.ToString(operation));
@@ -445,14 +445,14 @@ protected FilePath(FilePath? parent)
445445

446446
public override string ToString()
447447
=> ToString(null);
448-
448+
449449
public string ToString(int? operation)
450450
{
451451
var sb = new StringBuilder();
452452
var current = this;
453453
var first = true;
454454

455-
while (current is not RootFilePath)
455+
while (current is not RootFilePath and not null)
456456
{
457457
if (current is NameFilePath name)
458458
{
@@ -515,4 +515,4 @@ public IndexFilePath(FilePath? parent, int index) : base(parent)
515515

516516
public int Index { get; }
517517
}
518-
}
518+
}

0 commit comments

Comments
 (0)