Browse Source

Fix bug in JsonDB.list_docs when folder doesn't exist

pull/2/head
Noah Petherbridge 4 years ago
parent
commit
bf18978195
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      rophako/jsondb.py

+ 3
- 0
rophako/jsondb.py View File

@@ -112,6 +112,9 @@ def list_docs(path, recursive=False):
112 112
     root = os.path.join(Config.db.db_root, path)
113 113
     docs = list()
114 114
 
115
+    if not os.path.isdir(root):
116
+        return []
117
+
115 118
     for item in sorted(os.listdir(root)):
116 119
         target = os.path.join(root, item)
117 120
         db_path = os.path.join(path, item)

Loading…
Cancel
Save