diff --git a/bwkeepass.py b/bwkeepass.py index faafb87..69e6294 100644 --- a/bwkeepass.py +++ b/bwkeepass.py @@ -29,6 +29,9 @@ except (FileNotFoundError, IndexError): def _get_contents_from_keepass(path): + if not KEEPASS_FILE or not KEEPASS_PASS: + raise FaultUnavailable('BW_KEEPASS_FILE and/or BW_KEEPASS_PASSWORD missing') + if isinstance(path, list): list_path = path string_path = '|'.join(path) @@ -47,9 +50,6 @@ def _get_contents_from_keepass(path): path=list_path, file=KEEPASS_FILE, )): - if not KEEPASS_FILE or not KEEPASS_PASS: - raise FaultUnavailable('BW_KEEPASS_FILE and/or BW_KEEPASS_PASSWORD missing') - try: keepass = PyKeePass(expanduser(KEEPASS_FILE), KEEPASS_PASS)