[android] - check for null value when calling mapboxMap.clear

This commit is contained in:
tobrun
2017-11-06 15:28:11 +01:00
committed by Tobrun
parent d29ebe3d3f
commit 4d486e10ce

View File

@@ -143,11 +143,14 @@ class IconManager {
}
void iconCleanup(Icon icon) {
int refCounter = iconMap.get(icon) - 1;
if (refCounter == 0) {
remove(icon);
} else {
updateIconRefCounter(icon, refCounter);
Integer refCounter = iconMap.get(icon);
if (refCounter != null) {
refCounter--;
if (refCounter == 0) {
remove(icon);
} else {
updateIconRefCounter(icon, refCounter);
}
}
}