diff options
Diffstat (limited to 'materials_library_vx')
-rw-r--r-- | materials_library_vx/__init__.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/materials_library_vx/__init__.py b/materials_library_vx/__init__.py index 5891bdc5..9a8b47f9 100644 --- a/materials_library_vx/__init__.py +++ b/materials_library_vx/__init__.py @@ -265,10 +265,11 @@ def get_libraries(): libs = [Library(matlib_path, f) for f in os.listdir(matlib_path) if f[-5::] == "blend"] try: user_path = bpy.context.user_preferences.addons[__name__].preferences.matlib_path - if os.path.exists(user_path): - libs.extend([Library(user_path, f) for f in os.listdir(user_path) if f[-5::] == "blend"]) - else: - print("path not found %s" % user_path) + if user_path: + if os.path.exists(user_path): + libs.extend([Library(user_path, f) for f in os.listdir(user_path) if f[-5::] == "blend"]) + else: + print("path not found %s" % user_path) except: pass return sorted(libs, key=lambda x: bpy.path.display_name(x.name)) |