Skip to content

Conversation

@albertmoravec
Copy link
Contributor

Added missing checks which caused crashes in certain situations on Android.

This is probably an issue on iOS as well, but I don't have access to my Mac at the moment. I'll open a separate PR for iOS if I am able to confirm and fix this.

@kuhnroyal
Copy link
Contributor

@albertmoravec Can you describe these "certain situations"? Maybe I can reproduce them on iOS.

@albertmoravec
Copy link
Contributor Author

@albertmoravec Can you describe these "certain situations"? Maybe I can reproduce them on iOS.

Ah, I did not have much time to check myself, but generally you can break a lot of things by changing map style (e.g. between normal and satellite map) and doing other stuff like clicking into the map while it is loading. At least that's how I triggered this on Android.

The map tends to break a lot when you put all its features under stress when style is loading, since a lot of places are missing necessary checks and that breaks Flutter a bit more than for native apps.

@gabbopalma gabbopalma requested a review from Copilot September 30, 2025 14:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds null safety checks to prevent crashes on Android by ensuring the map style is fully loaded before accessing its layers. The changes address situations where style operations were attempted before the style finished loading.

  • Added style.isFullyLoaded() checks alongside existing null checks
  • Applied the fix to two methods that access style layers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gabbopalma gabbopalma self-requested a review September 30, 2025 14:11
@gabbopalma gabbopalma changed the base branch from main to release-0.23.0 September 30, 2025 14:17
@gabbopalma gabbopalma requested a review from Copilot September 30, 2025 15:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gabbopalma
Copy link
Collaborator

Hi @albertmoravec, thanks for your efforts and contribution!
This will be added to 0.23.0 version release.

Sorry for the late review

@gabbopalma gabbopalma merged commit 8559539 into maplibre:release-0.23.0 Sep 30, 2025
9 checks passed
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.

3 participants