Add validation to hash type array

This commit is contained in:
Matt Nadareski
2025-02-19 14:42:41 -05:00
parent 5880de90fa
commit fb5e32c14b

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
@@ -54,6 +55,9 @@ namespace SabreTools.DatTools
public DatFromDir(HashType[] hashes, SkipFileType skipFileType, bool addBlanks)
{
if (hashes.Length == 0)
throw new ArgumentException($"{nameof(hashes)} must contain at least one valid HashType");
_hashes = hashes;
_skipFileType = skipFileType;
_addBlanks = addBlanks;