Skip to content

Conversation

@albertmoravec
Copy link
Contributor

@albertmoravec albertmoravec commented Dec 19, 2024

I discovered that in certain cases getLocationEngine() can be called even if location component was not activated (possibly if someone tried to activate it before style was loaded), causing an unhandled exception (see #534). I have no idea why a getter call would ever need to crash, but here we are.

I added isLocationComponentActivated() check in every place where getLocationEngine() is called. It is not the most elegant solution for sure, but since there are other checks in place it seemed appropriate and allowed me to avoid wrapping the getter in another getter.

I also added missing else branch in getLastLocation call handler. I chose "LOCATION DISABLED" as an error code since I could not find any standardized list of error codes. Feel free to suggest alternatives.

@josxha josxha linked an issue Dec 19, 2024 that may be closed by this pull request
@albertmoravec
Copy link
Contributor Author

Also closes #508

@albertmoravec
Copy link
Contributor Author

albertmoravec commented Mar 17, 2025

@josxha bump, are pipelines fixed now so that this can be merged?

EDIT: Rebased onto latest main, let's see if it works now.

@josxha josxha merged commit de67ad9 into maplibre:main Mar 17, 2025
9 checks passed
@albertmoravec
Copy link
Contributor Author

👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants