From 3a58c4679ae0405ba818d097b3566ca7a332bc0e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 30 Jul 2014 15:35:19 +0200 Subject: Fix addon crash when trying listdir a directory we have no permission to. --- release/scripts/modules/bpy/path.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'release/scripts/modules/bpy/path.py') 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 -- cgit v1.2.3