Fix bug in JsonDB.list_docs when folder doesn't exist
This commit is contained in:
parent
8786b8d49c
commit
bf18978195
|
@ -112,6 +112,9 @@ def list_docs(path, recursive=False):
|
||||||
root = os.path.join(Config.db.db_root, path)
|
root = os.path.join(Config.db.db_root, path)
|
||||||
docs = list()
|
docs = list()
|
||||||
|
|
||||||
|
if not os.path.isdir(root):
|
||||||
|
return []
|
||||||
|
|
||||||
for item in sorted(os.listdir(root)):
|
for item in sorted(os.listdir(root)):
|
||||||
target = os.path.join(root, item)
|
target = os.path.join(root, item)
|
||||||
db_path = os.path.join(path, item)
|
db_path = os.path.join(path, item)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user