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

Prevent calls to getLayoutProperty from causing fatal error when layer doesn't exist #7539

Merged
merged 4 commits into from
Nov 2, 2018

Conversation

ryanhamley
Copy link
Contributor

Fixes #7537

Launch Checklist

  • briefly describe the changes in this PR
    • When calling map.getLayoutProperty() for a layer that does not exist, a fatal error would fire. setLayoutProperty() fires a warning error to handle this situation. This PR updates getLayoutProperty to do the same thing.
    • Also updates the layer argument to layerId to match setLayoutProperty
  • manually test the debug page

Copy link
Contributor

@mollymerp mollymerp left a comment

Choose a reason for hiding this comment

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

Can we add a unit test for this?

@ryanhamley ryanhamley force-pushed the getlayoutproperty-error-handling branch from 74775c1 to 2d0b712 Compare November 1, 2018 23:27
@ryanhamley
Copy link
Contributor Author

Test added @mollymerp

Copy link
Contributor

@mollymerp mollymerp left a comment

Choose a reason for hiding this comment

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

🙇‍♀️ thanks!!

strange that these linting errors are just now popping up. it'd be good to rebase this into 2 commits, one for the fix+test, one for the unrelated linter changes and then "Rebase and merge" instead of "Squash and merge"

This reverts commit 2d0b712.
@ryanhamley
Copy link
Contributor Author

I pulled the linter fixes out to #7541

@ryanhamley ryanhamley merged commit c8bb20d into master Nov 2, 2018
@ryanhamley ryanhamley deleted the getlayoutproperty-error-handling branch November 2, 2018 00:23
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.

2 participants