Skip to content

Commit

Permalink
[Refactor] using ArgumentNullException.ThrowIfNull
Browse files Browse the repository at this point in the history
  • Loading branch information
samatstariongroup committed Oct 6, 2024
1 parent bca6d64 commit 4a99060
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions NetProjectPackageExtractor/Services/PackageToExcelWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,10 @@ public class PackageToExcelWriter : IPackageToExcelWriter
/// </param>
public void WriteSoftwareReuseFile(IEnumerable<Package> packages, FileInfo result)
{
if (packages == null)
{
throw new ArgumentNullException(nameof(packages));
}
ArgumentNullException.ThrowIfNull(packages);

ArgumentNullException.ThrowIfNull(result);

if (result == null)
{
throw new ArgumentNullException(nameof(result));
}

using (var workbook = new XLWorkbook())
{
AddLibrariesSheet(packages, workbook);
Expand Down

0 comments on commit 4a99060

Please sign in to comment.