fixed exception when looking up a commander with hidden activity

This commit is contained in:
alterNERDtive 2022-09-05 21:30:51 +02:00
parent ff112cf8ed
commit 240ada35f7
Signed by: alterNERDtive
GPG key ID: 547787A4FE6533F1
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,12 @@
# devel
## Fixed
* Looking up a CMDR with public profile, but hidden activity (= no date of last
activity) will no longer throw an exception.
-----
# 0.2 (2022-07-02)
## Added

View file

@ -49,7 +49,11 @@ class Commander(Positionable):
json = logsApi.Position.getSystem(self.name, self.apiKey)
self.profileUrl = json
if 'dateLastActivity' in json:
return dateparser.parse(json['dateLastActivity'])
date = json['dateLastActivity']
if date is None:
return None
else:
return dateparser.parse(json['dateLastActivity'])
else:
return None