Add lower-bound check to index for sample execution

このコミットが含まれているのは:
Michael A. Hawker committed 2021-11-07 14:21:25 -08:00
1 親 fd711db2e8
コミット e28d8b30c0
1ファイル変更
+2 -2
+2 -2
ファイルの表示
@@ -56,14 +56,14 @@ class Program
}
while (!int.TryParse(Console.ReadLine(), out index));
if (index < Samples.Length)
if (index >= 0 && index < Samples.Length)
{
Console.WriteLine();
Console.WriteLine($"Starting {Samples[index].GetType().GenericTypeArguments[0].Name}...");
Win32ApplicationRunner.Run(Samples[index]);
}
} while (index < Samples.Length);
} while (index >= 0 && index < Samples.Length);
}
/// <summary>