浏览代码

FIX scripts suggestions cause crash on web edit

The directory was assumed to be existing, which is wrong
boyska 7 年之前
父节点
当前提交
da50bcdb96
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      larigira/dbadmin/suggestions.py

+ 2 - 0
larigira/dbadmin/suggestions.py

@@ -41,6 +41,8 @@ def get_suggested_dirs():
 
 def get_suggested_scripts():
     base = get_conf()['SCRIPTS_PATH']
+    if not base or not os.path.isdir(base):
+        return []
     fnames = [f for f in os.listdir(base)
               if os.access(os.path.join(base, f), os.R_OK | os.X_OK)]
     return fnames