From 52c50f54a7b9c34f70249cc214fdc40aa2a5e735 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 26 Jan 2017 18:09:16 -0800 Subject: [PATCH] [DatFile] Fix temp directory in verify --- SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs b/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs index 10e4aff4..37a5e87c 100644 --- a/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs +++ b/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs @@ -474,7 +474,13 @@ namespace SabreTools.Helper.Dats /// True if verification was a success, false otherwise public bool VerifyDirectory(List inputs, string tempDir, bool hashOnly, string headerToCheckAgainst, Logger logger) { - // First create or clean the temp directory + // Check the temp directory exists + if (String.IsNullOrEmpty(tempDir)) + { + tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + } + + // Then create or clean the temp directory if (!Directory.Exists(tempDir)) { Directory.CreateDirectory(tempDir);