From 042d0861e97d853f4ed68e1e555506fcf1d25a25 Mon Sep 17 00:00:00 2001 From: Becky Smith Date: Wed, 21 Apr 2021 16:44:57 +0100 Subject: [PATCH] Fix bug if no salt files --- CHANGELOG.rst | 4 ++++ kpcli/datastructures.py | 2 +- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4248eb8..9fac0e8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,7 @@ +0.2.4 +----- +Fix bug if salt files deleted + 0.2.3 ----- Bugfix diff --git a/kpcli/datastructures.py b/kpcli/datastructures.py index 8ce2a6f..3e576c7 100644 --- a/kpcli/datastructures.py +++ b/kpcli/datastructures.py @@ -135,7 +135,7 @@ def setup(self): def get_password(self): self.setup() - if self.latest_salt_file.exists() and self.password_file.exists(): + if self.latest_salt_file is not None and self.password_file.exists(): timestamp = float(self.latest_salt_file.name.split("_")[-1]) # check timestamp and delete/refresh salt every 24 hrs if datetime.now().timestamp() - timestamp > self.timeout: diff --git a/pyproject.toml b/pyproject.toml index 3fef3ab..3451423 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "kpcli" -version = "0.2.3" +version = "0.2.4" description = "A simple command line tool to interact with KeePassX databases" authors = ["Becky Smith "] license = "GPL-3.0-or-later"