diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-07-30 17:35:19 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-07-30 17:35:19 +0400 |
commit | 3a58c4679ae0405ba818d097b3566ca7a332bc0e (patch) | |
tree | b7a3f91e6116fe4900892397109c68c901124aa4 /release | |
parent | 74758576fc9c1220563c86ce47a17c51d08a6d4f (diff) |
Fix addon crash when trying listdir a directory we have no permission to.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/bpy/path.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py index ccc9df93b0d..874efc2e131 100644 --- a/release/scripts/modules/bpy/path.py +++ b/release/scripts/modules/bpy/path.py @@ -219,7 +219,10 @@ def resolve_ncase(path): # we are expecting 'dirpath' to be a directory, but it could be a file 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: return path, False |