Skip to content

JavaKit: map NULL jstring to the empty string #158

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 1 commit into from
Nov 7, 2024

Conversation

lhoward
Copy link
Contributor

@lhoward lhoward commented Nov 7, 2024

Fixes: #155

Copy link
Collaborator

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

lgtm, is it possible to write a test for this though?

@lhoward
Copy link
Contributor Author

lhoward commented Nov 7, 2024

Will look at tomorrow.

There's an impedance mismatch here between the JNIType (which is optional) and
the Swift type. Assuming this is intentional than init(fromJNI:in) should check
for a NULL value and map it to the empty string.

Fixes: swiftlang#155
@lhoward
Copy link
Contributor Author

lhoward commented Nov 7, 2024

added tests

@ktoso
Copy link
Collaborator

ktoso commented Nov 7, 2024

Thank you!

@ktoso ktoso merged commit 79237aa into swiftlang:main Nov 7, 2024
11 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.

JavaKit: Android GetStringUTFChars() doesn't handle NULL strings
2 participants