forked from bartvdbraak/blender
Fix addon crash when trying listdir a directory we have no permission to.
This commit is contained in:
parent
74758576fc
commit
3a58c4679a
@ -219,7 +219,10 @@ def resolve_ncase(path):
|
|||||||
|
|
||||||
# we are expecting 'dirpath' to be a directory, but it could be a file
|
# we are expecting 'dirpath' to be a directory, but it could be a file
|
||||||
if _os.path.isdir(dirpath):
|
if _os.path.isdir(dirpath):
|
||||||
files = _os.listdir(dirpath)
|
try:
|
||||||
|
files = _os.listdir(dirpath)
|
||||||
|
except PermissionError: # We might not have the permission to list dirpath...
|
||||||
|
return path, False
|
||||||
else:
|
else:
|
||||||
return path, False
|
return path, False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user