fixed exception when looking up a commander with hidden activity
This commit is contained in:
parent
ff112cf8ed
commit
240ada35f7
2 changed files with 14 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue