Fixed PESTERCHUM:TIME> related crash

This commit is contained in:
Dpeta 2021-09-18 12:39:38 +02:00
parent 0804bf16eb
commit d231f2f785
2 changed files with 17 additions and 7 deletions

View file

@ -1,6 +1,12 @@
# Changelog # Changelog
(This document uses YYYY-MM-DD) (This document uses YYYY-MM-DD)
## [v2.1.3.1] - 2021-9-18
### Fixed
- Crash for certain invalid values of PESTERCHUM:TIME>
## [v2.1.3.1] - 2021-8-24 ## [v2.1.3.1] - 2021-8-24
### Added ### Added

View file

@ -1021,14 +1021,18 @@ class PesterMemo(PesterConvo):
s = (timed.seconds // 60)*60 s = (timed.seconds // 60)*60
timed = timedelta(timed.days, s) timed = timedelta(timed.days, s)
except ValueError: except ValueError:
if cmd == "i": try:
timed = timedelta(0) if cmd == "i":
else: timed = timedelta(0)
if cmd[len(cmd)-1] == 'c':
close = timeProtocol(cmd)
timed = None
else: else:
timed = timeProtocol(cmd) if cmd[len(cmd)-1] == 'c':
close = timeProtocol(cmd)
timed = None
else:
timed = timeProtocol(cmd)
except:
PchumLog.warning("Invalid PESTERCHUM:TIME> " + str(cmd))
timed = timedelta(0)
if handle in self.times: if handle in self.times:
if close is not None: if close is not None: