Skip to content

Commit 7857fdf

Browse files
committed
First attempt
1 parent 06aec34 commit 7857fdf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/code/PSResourceInfo.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,8 @@ public static bool TryConvertFromJson(
726726
{
727727
foreach (
728728
JsonElement dependencyGroup in dependencyGroupsElement.EnumerateArray().Where(
729-
x => !string.IsNullOrWhiteSpace(x.GetProperty("@id").GetString())
729+
x => x.TryGetProperty("id", out JsonElement idProperty) &&
730+
!string.IsNullOrWhiteSpace(idProperty.GetString())
730731
)
731732
)
732733
{
@@ -736,7 +737,8 @@ JsonElement dependencyGroup in dependencyGroupsElement.EnumerateArray().Where(
736737
{
737738
foreach (
738739
JsonElement dependency in dependenciesElement.EnumerateArray().Where(
739-
x => !string.IsNullOrWhiteSpace(x.GetProperty("@id").GetString())
740+
x => x.TryGetProperty("id", out JsonElement idProperty) &&
741+
!string.IsNullOrWhiteSpace(idProperty.GetString())
740742
)
741743
)
742744
{

0 commit comments

Comments
 (0)