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
This commit is contained in:
Harley Acheson 2023-02-04 13:44:10 -08:00
parent 1a13940ef8
commit b2196ebe28
Notes: blender-bot 2023-02-13 13:25:53 +01:00
Referenced by issue #104366, Freestyle edges are still calculated  (but not shown) for objects that are in an excluded collection
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}