Added a check to MathUtil::md5Hash() to not attempt to hash directories

This commit is contained in:
Leon Styhre 2023-08-03 20:14:04 +02:00
parent ee7bc6481e
commit 590591d0fb

View file

@ -15,6 +15,7 @@
#include "utils/MathUtil.h"
#include "utils/FileSystemUtil.h"
#include "utils/StringUtil.h"
#include <cstring>
@ -108,6 +109,8 @@ namespace Utils
state[3] = 0x10325476;
if (isFilePath) {
if (Utils::FileSystem::isDirectory(hashArg))
return "";
#if defined(_WIN64)
std::ifstream inputFile {Utils::String::stringToWideString(hashArg).c_str(),
std::ios::binary};