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 crash in nativeInjectHMRUpdate #22412

Merged
merged 2 commits into from
Nov 26, 2018

Conversation

vovkasm
Copy link
Contributor

@vovkasm vovkasm commented Nov 26, 2018

Fix crash in nativeInjectHMRUpdate if it is called with only one argument from JS

Fixes #22116

For more deep explanation, see comments thread from here: #22116 (comment)

Environment:

This fix dedicated for 0.57-stable branch, because crashed code was part of old JSC executor, that was replaced in master with new JSI code.

Test Plan:

Ensure that application no more crash when enable HMR from dev menu.

Changelog:

[iOS] [Fixed] - Fix application crash when HMR enabled

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 26, 2018
@@ -113,7 +113,7 @@ static JSValueRef nativeInjectHMRUpdate(
const JSValueRef arguments[],
JSValueRef* exception) {
String execJSString = Value(ctx, arguments[0]).toString();
String jsURL = Value(ctx, arguments[1]).toString();
String jsURL = argumentCount > 1 ? Value(ctx, arguments[1]).toString() : String();
Copy link
Contributor

Choose a reason for hiding this comment

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

would you mind just adding a comment for our future selves, something like

temporary workaround for 0.57 and Metro 48

so that if I encounter any issue in future releases/cherry-picks I can quickly remember what this was about?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done :-)

@kelset
Copy link
Contributor

kelset commented Nov 26, 2018

Thanks for being so quick! Super appreciated :) If you can add the comment it would be perfect, in the meantime I'll have it double-checked & tested in my release :)

(btw, if you are on twitter, can you shoot me a DM over there?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants