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

Added handling for null geometry field #265

Closed
wants to merge 10 commits into from
Closed

Conversation

ajolipa
Copy link
Contributor

@ajolipa ajolipa commented Mar 9, 2024

In this PR

Improves the error handling of the PlaceMarker component to simply return null rather than throw page-breaking errors when the object fetched from Core Data has no value in the geometry field, addressing Issue #258 .

Notes

For now the simplest seemed to be to just add this case to the check for the existence of overall place data. The behavior seems to be that since the PlaceMarker component returns null, the map simply renders as a world atlas with no place highlighted, which seems like reasonable default behavior to me but obviously could be modified further if desired.

@ajolipa ajolipa requested a review from dleadbetter March 9, 2024 05:40
@ajolipa ajolipa linked an issue Mar 11, 2024 that may be closed by this pull request
@ajolipa ajolipa added the v2.1.0 Issues in v2.1.0 label Mar 11, 2024
Copy link
Collaborator

@dleadbetter dleadbetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about this some more. The actual error is coming from one of the components in the Peripleo dependency. Is this something we should handle in the LocationMarker component instead?

@ajolipa
Copy link
Contributor Author

ajolipa commented Mar 12, 2024

I believe that with the update to the PlaceMarkers component this is no longer an issue; in the current version, the response from Core Data is being fed into the feature or featureColleciton function from turf, which in the case that the geometry data passed in is null will return an empty array of features. This will then fail the new check _.isEmpty(data?.features and thus the component will return null rather than trying to render the LocationMarkers component. If that seems like reasonable/desired behavior, then I think this PR can be closed.

@ajolipa
Copy link
Contributor Author

ajolipa commented Mar 18, 2024

Closing (this is an older version of PR #269 ).

@ajolipa ajolipa closed this Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.1.0 Issues in v2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Error handling for Place without Geometry
2 participants