Skip to content

Commit 375754c

Browse files
committed
Handle parsing a world that has never been online.
1 parent 9ec3c0d commit 375754c

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ Changelog
77
Try to always use the latest version.
88

99

10+
.. v5.7.1
11+
12+
5.7.1 (2024-04-09)
13+
==================
14+
- Handle parsing a world that has never been online.
15+
16+
1017
.. v5.7.0
1118
1219
5.7.0 (2024-04-05)

tibiapy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Tibia.com parsing and fetching library."""
2-
__version__ = '5.7.0'
2+
__version__ = '5.7.1'
33
__author__ = 'Allan Galarza'
44
__license__ = 'Apache-2.0 License'
55

tibiapy/world.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,11 @@ def _parse_world_info(self, world_info_table):
320320
self.location = try_enum(WorldLocation, world_info.pop("location"))
321321
self.pvp_type = try_enum(PvpType, world_info.pop("pvp_type"))
322322
self.transfer_type = try_enum(TransferType, world_info.pop("transfer_type", None), TransferType.REGULAR)
323-
m = record_regexp.match(world_info.pop("online_record"))
324-
if m:
325-
self.record_count = parse_integer(m.group("count"))
326-
self.record_date = parse_tibia_datetime(m.group("date"))
323+
if "online_record" in world_info:
324+
m = record_regexp.match(world_info.pop("online_record"))
325+
if m:
326+
self.record_count = parse_integer(m.group("count"))
327+
self.record_date = parse_tibia_datetime(m.group("date"))
327328
if "world_quest_titles" in world_info:
328329
self.world_quest_titles = [q.strip() for q in world_info.pop("world_quest_titles").split(",")]
329330
if self.world_quest_titles and "currently has no title" in self.world_quest_titles[0]:

0 commit comments

Comments
 (0)