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

harden locationToFeature against non-string country names #2122

Merged
merged 1 commit into from
Oct 26, 2017

Conversation

alexcjohnson
Copy link
Collaborator

Before, with locationmode: 'country names', non-string locations would throw an error:

Uncaught TypeError: Cannot read property 'trim' of null
    at countryNameToISO3 (geo_location_utils.js:54)

Now they're just ignored silently - as opposed to strings that are unrecognized that generate a console warning. If it's just empty it seems clear you don't even want a warning. I suppose if it's not empty but also not a string it could be nice to still generate a warning, though that's not how most of plotly.js handles invalid data...

cc @etpinard

@alexcjohnson alexcjohnson added the bug something broken label Oct 26, 2017
@etpinard
Copy link
Contributor

Beautifully done. Thanks 💃

@alexcjohnson alexcjohnson merged commit b155301 into master Oct 26, 2017
@alexcjohnson alexcjohnson deleted the geo-robust branch October 26, 2017 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants