From bf18978195a8a165c9b8d642f2caaef5444abcf8 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Mon, 20 Jul 2015 14:10:09 -0700 Subject: [PATCH] Fix bug in JsonDB.list_docs when folder doesn't exist --- rophako/jsondb.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rophako/jsondb.py b/rophako/jsondb.py index a48f08d..f6a3e8d 100644 --- a/rophako/jsondb.py +++ b/rophako/jsondb.py @@ -112,6 +112,9 @@ def list_docs(path, recursive=False): root = os.path.join(Config.db.db_root, path) docs = list() + if not os.path.isdir(root): + return [] + for item in sorted(os.listdir(root)): target = os.path.join(root, item) db_path = os.path.join(path, item)