mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-02 19:20:09 +03:00
Fix negative timestamp issue
Some timestamps can be negative, and anything lower than -43200 throws OSError. Handle that by changing the `value == 0` check to `value <= 0`
This commit is contained in:
parent
de85c34462
commit
14b1226066
|
@ -120,7 +120,7 @@ class BinaryReader:
|
|||
into a Python datetime object.
|
||||
"""
|
||||
value = self.read_int()
|
||||
if value == 0:
|
||||
if value <= 0:
|
||||
return None
|
||||
else:
|
||||
return datetime.fromtimestamp(value, tz=timezone.utc)
|
||||
|
|
Loading…
Reference in New Issue
Block a user