Fix: ensure loaded path is folder and not file #104812

Closed
Daniel Grauer wants to merge 4 commits from DanielGrauer:fix-error-when-file-is-selected into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit a3ca868eb3 - Show all commits

View File

@ -51,6 +51,12 @@ ext_list = ['.bmp',
fakeUser = False fakeUser = False
def LoadBrushSet(filepath, filename): def LoadBrushSet(filepath, filename):
# Ensure filepath is a path and not a file (this can happen when the user selects a file within the folder)
if os.path.isfile(filepath):
path, file = os.path.split(filepath)
filepath = os.path.join(path + "\\")
for file in os.listdir(filepath): for file in os.listdir(filepath):
path = (filepath + file) path = (filepath + file)