Skip to content

Commit 07acbdb

Browse files
committed
Apply suggestions from code review
1 parent 0fef145 commit 07acbdb

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

windows.system.diagnostics/processdiagnosticinfo_getforprocesses_1262014773.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,16 @@ class Program
5353
{
5454
foreach (var appDiagnosticInfo in appDiagnosticInfos)
5555
{
56-
var appInfo = appDiagnosticInfo.AppInfo;
56+
var appInfo = appDiagnosticInfo.AppInfo;
57+
if (appInfo != null)
58+
{
5759
Console.WriteLine($"Process ID: {process.ProcessId}, Package Name: {appInfo.PackageFamilyName}");
5860
}
61+
else
62+
{
63+
Console.WriteLine($"Process ID: {process.ProcessId} has no associated AppInfo.");
64+
}}");
65+
}
5966
}
6067
}
6168
else

0 commit comments

Comments
 (0)