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

Allow StyleManagerInterface.getSourceAs return null #88

Merged
merged 1 commit into from
Feb 10, 2021

Conversation

kiryldz
Copy link
Contributor

@kiryldz kiryldz commented Feb 10, 2021

PRs must be submitted under the terms of our Contributor License Agreement CLA.
<changelog>Allow StyleManagerInterface.getSourceAs return null</changelog>

Pull request checklist:

  • Briefly describe the changes in this PR.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality. If tests were not written, please explain why.
  • Add example if relevant.
  • Document any changes to public APIs.
  • Apply changelog label ('breaking change', 'bug 🪲', 'build', 'docs', 'feature 🍏', 'performance ⚡', 'testing 💯') or use the label 'skip changelog'
  • Add an entry inside this element for inclusion in the mapbox-maps-android changelog: <changelog></changelog>.

Summary of changes

Allow returning null for getSourceAs function when no such source is found or could not cast to given source.

User impact (optional)

@kiryldz kiryldz added the bug 🪲 Something isn't working label Feb 10, 2021
@kiryldz kiryldz requested review from tobrun and a team February 10, 2021 07:55
@kiryldz kiryldz self-assigned this Feb 10, 2021
Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

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

Looks good, I'm fine with using !! in testapp to fail fast.

@kiryldz
Copy link
Contributor Author

kiryldz commented Feb 10, 2021

Looks good, I'm fine with using !! in testapp to fail fast.

I did it intentionally for examples, you're totally correct.

@kiryldz kiryldz merged commit 7364874 into main Feb 10, 2021
@kiryldz kiryldz deleted the kdz-nullable-get-source branch February 10, 2021 08:40
@VincentJoshuaET
Copy link

This should also be done with getLayerAs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants