From 90b6062ebbea8f92a52bc621683cfe6ca8852ff4 Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Sun, 10 Nov 2019 09:51:09 +0100 Subject: [PATCH] Handle missing file properly when checking for case mismatch This was causing false alarms to be randomly reported on Windows for files that didn't exist. --- drivers/windows/file_access_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index fb21c0c5a14..4dc1b74310b 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -96,7 +96,7 @@ Error FileAccessWindows::_open(const String &p_path, int p_mode_flags) { if (p_mode_flags == READ) { WIN32_FIND_DATAW d; HANDLE f = FindFirstFileW(path.c_str(), &d); - if (f) { + if (f != INVALID_HANDLE_VALUE) { String fname = d.cFileName; if (fname != String()) {