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

[expo-localization] Fix constants exporting #5740

Merged
merged 2 commits into from Oct 15, 2019

Conversation

lukmccall
Copy link
Contributor

Why

Resolve #5735.

How

Wrapped region variable into UMNullIfNil macro, because [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode] could return nil on iOS simulator.

@lukmccall lukmccall changed the title [expo-localization] Fix exported constants [expo-localization] Fix constants exporting Sep 23, 2019
@sjchmiela
Copy link
Contributor

If I'm correct, if this would be the cause of the issue linked, reporting users would get crashes (could not insert nil to a dictionary) instead of JS problems. Are you sure this fixes the issue? 🤔

@lukmccall
Copy link
Contributor Author

That's true, you can't insert nil to a dictionary.
However, this code compiles and doesn't throw any exception:

NSString *b = nil;
return @{
  @"a": b
}

Unfortunately, bridge can't read correct values from this dictionary.

@brentvatne
Copy link
Member

we should add a test that would have caught this regression to ensure it doesn't happen again

@tsapeta tsapeta merged commit d3584d7 into master Oct 15, 2019
@tsapeta tsapeta deleted the @lukmccall/expo-localization-fix-locale-is-undefined branch October 15, 2019 14:21
@marudy
Copy link

marudy commented Jan 16, 2020

I still get the same issue after upgrading expo localisation to current latest^8.0.0",.

Screenshot 2020-01-16 at 16 57 08

Do we have an open issue about it and maybe an upcoming fix? Or am I missing something? Thanks

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.

After Upgrade to SDK 33: undefined is not an object (evaluating '_expo Localization.Localization.locale')
5 participants