Skip to content

Commit

Permalink
Added null checks to prevent null pointer exception (#62013)
Browse files Browse the repository at this point in the history
Co-authored-by: JochemH <jharmes@chipsoft.nl>
  • Loading branch information
Haarmees and JochemH authored Nov 24, 2021
1 parent 89e3040 commit 292632f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/coreclr/tools/ILVerify/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private Program(Options options)
string[] includePatterns = options.Include;
if (options.IncludeFile != null)
{
if (options.Include.Length != 0)
if (options.Include != null && options.Include.Length != 0)
WriteLine("[Warning] --include-file takes precedence over --include");
includePatterns = File.ReadAllLines(options.IncludeFile.FullName);
}
Expand All @@ -105,7 +105,7 @@ private Program(Options options)
string[] excludePatterns = options.Exclude;
if (options.ExcludeFile != null)
{
if (options.Exclude.Length != 0)
if (options.Exclude != null && options.Exclude.Length != 0)
WriteLine("[Warning] --exclude-file takes precedence over --exclude");
excludePatterns = File.ReadAllLines(options.ExcludeFile.FullName);
}
Expand All @@ -114,7 +114,7 @@ private Program(Options options)
string[] ignoreErrorPatterns = options.IgnoreError;
if (options.IgnoreErrorFile != null)
{
if (options.IgnoreError.Length != 0)
if (options.IgnoreError != null && options.IgnoreError.Length != 0)
WriteLine("[Warning] --ignore-error-file takes precedence over --ignore-error");
ignoreErrorPatterns = File.ReadAllLines(options.IgnoreErrorFile.FullName);
}
Expand Down

0 comments on commit 292632f

Please sign in to comment.