Skip to content

fix: Check for null pointers when using R_ExternalPtrAddr directly #282

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

Merged
merged 2 commits into from
Jun 2, 2025

Conversation

paleolimbot
Copy link
Collaborator

Closes #281

In most of the package we use Rcpp, which throws for this case:

library(s2)

geog <- as_s2_geography("POINT (0 1)")
s2_area(unserialize(serialize(geog, NULL)))
#> Error: external pointer is not valid

Created on 2025-05-28 with reprex v2.1.1

...but the print() goes through wk_format(), which used the C API directly.

@paleolimbot paleolimbot merged commit 698a005 into main Jun 2, 2025
7 of 10 checks passed
@paleolimbot paleolimbot deleted the check-pointers branch June 2, 2025 15:45
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.

[Contribution] Serialization support for s2_geography
1 participant