Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix no-element exception when href is absent #25

Merged
merged 1 commit into from
Jan 15, 2024
Merged

Conversation

arthurbcd
Copy link
Contributor

Description:

Issue: Currently, the GPX reader crashes when it encounters a GPX link () element without an href attribute.

Proposed Solution: This PR introduces a safeguard against such scenarios. Instead of crashing, the reader will now handle missing href attributes gracefully.

Implementation Details:

Added a check for the presence of the href attribute in a GPX link.

  • If href is present, the reader behaves as usual, extracting its first value.
  • If href is absent, the reader will not attempt to access it, avoiding a crash. This is seamless as our default href parameter is already set to an empty string ('').

Benefit: This change enhances the robustness of the GPX reader, allowing it to process GPX files with missing href attributes in links without failing.

@kb0 kb0 merged commit e1079c6 into kb0:master Jan 15, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants