[Bf-blender-cvs] [b2196ebe287] master: Win32: Relax Debug Assert in BLI_file_attributes

Harley Acheson noreply at git.blender.org
Sat Feb 4 22:45:53 CET 2023


Commit: b2196ebe287ff54b0304f600031f49e683355409
Author: Harley Acheson
Date:   Sat Feb 4 13:44:10 2023 -0800
Branches: master
https://developer.blender.org/rBb2196ebe287ff54b0304f600031f49e683355409

Win32: Relax Debug Assert in BLI_file_attributes

If GetFileAttributesW returns an error, only debug assert if the reason
is file not found.

See D17204 for more details.

Differential Revision: https://developer.blender.org/D17204

Reviewed by Ray Molenkamp

===================================================================

M	source/blender/blenlib/intern/storage.c

===================================================================

diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 8c212bf1758..64f4a0b1a26 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -211,9 +211,9 @@ eFileAttributes BLI_file_attributes(const char *path)
   }
 
   DWORD attr = GetFileAttributesW(wline);
-  BLI_assert_msg(attr != INVALID_FILE_ATTRIBUTES,
-                 "BLI_file_attributes should only be called on existing files.");
   if (attr == INVALID_FILE_ATTRIBUTES) {
+    BLI_assert_msg(GetLastError() != ERROR_FILE_NOT_FOUND,
+                   "BLI_file_attributes should only be called on existing files.");
     return ret;
   }



More information about the Bf-blender-cvs mailing list