Skip to content

Commit f99049c

Browse files
author
Willi Ballenthin
committed
RegistryParse: raise exception when fetching non-existant value timestamp
1 parent 5ac3e5e commit f99049c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Registry/RegistryParse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ def name(self):
985985
if self.has_ascii_name():
986986
return unpacked_string.decode("windows-1252")
987987
return unpacked_string.decode("utf-16le")
988-
988+
989989
def has_timestamp(self):
990990
"""
991991
Has a timestamp? Only AppContainer settings.dat registry hive has this!
@@ -999,7 +999,7 @@ def timestamp(self):
999999
"""
10001000
if self.has_timestamp():
10011001
return parse_windows_timestamp(struct.unpack_from(str("<Q"), self.raw_data()[-8:])[0])
1002-
return None
1002+
raise ValueError('value does not have a timestamp')
10031003

10041004
def data_type(self):
10051005
"""

0 commit comments

Comments
 (0)