Skip to content

Commit ac440f5

Browse files
TsadoqCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 2a0be3c commit ac440f5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kompy/komoot_connector.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ def get_tours(
197197
try:
198198
tour_objects.append(Tour(tour_dict))
199199
except (KeyError, TypeError, ValueError) as e:
200-
logger.exception(f'Failed to parse tour {tour_dict.get("id", "unknown")}: {e}')
200+
tour_id = tour_dict.get('id', 'unknown') if isinstance(tour_dict, dict) else 'unknown'
201+
logger.exception(f'Failed to parse tour {tour_id}: {e}')
201202
return tour_objects
202203

203204
def get_tour_by_id(

0 commit comments

Comments
 (0)