diff --git a/CHANGELOG.rst b/CHANGELOG.rst index df2d5812..0070d0e2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,4 +1,10 @@ -4.0.4 - +4.0.5 - +------------------ +- fixed #344 - AttributeError when accessing Times with None value +- use __hash__ when evaluating equality +- use mtime/uuid for HistoryEntry hashing + +4.0.4 - 2023-05-23 ------------------ - fixed #314 - correctly handle binaries with no data - fixed #265 - check for keepass signature @@ -10,8 +16,8 @@ 4.0.3 - 2022-06-21 ------------------ -- add otp support -- add debug_setup() function +- added otp support +- added debug_setup() function 4.0.2 - 2022-05-21 ------------------ diff --git a/pykeepass/baseelement.py b/pykeepass/baseelement.py index 16245473..e9ffc391 100644 --- a/pykeepass/baseelement.py +++ b/pykeepass/baseelement.py @@ -93,7 +93,7 @@ def _get_times_property(self, prop): times = self._element.find('Times') if times is not None: prop = times.find(prop) - if prop is not None: + if prop is not None and prop.text is not None: return self._kp._decode_time(prop.text) def _set_times_property(self, prop, value): diff --git a/tests/test3.kdbx b/tests/test3.kdbx index 8c4858eb..ab02bbf7 100644 Binary files a/tests/test3.kdbx and b/tests/test3.kdbx differ diff --git a/tests/test4.kdbx b/tests/test4.kdbx index 7765b93d..937d79b1 100644 Binary files a/tests/test4.kdbx and b/tests/test4.kdbx differ diff --git a/tests/tests.py b/tests/tests.py index a6623213..bcabe355 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -960,6 +960,11 @@ def test_issue308(self): self.assertEqual(results, results2) + def test_issue344(self): + # accessing expiry_time throws exception when None + + e = self.kp.find_entries(title='none_date', first=True) + self.assertEqual(e.expiry_time, None) class EntryFindTests4(KDBX4Tests, EntryFindTests3): pass