Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
Add null check to zipfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ajami1331 committed Dec 15, 2023
1 parent 5ffaf16 commit 6fd4acb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static void Main(FileInfo? file = null)
return;
}

var configEntry = zipFile.GetEntry("Config.json");
var configEntry = zipFile!.GetEntry("Config.json");

if (configEntry == null)
{
Expand Down Expand Up @@ -186,7 +186,7 @@ public static bool IsZipValid(string path, out ZipArchive? zipFile)
try
{
zipFile = ZipFile.OpenRead(path);
return true;
return zipFile is not null;
}
catch (InvalidDataException)
{
Expand Down

0 comments on commit 6fd4acb

Please sign in to comment.