Skip to content

Commit

Permalink
Merge pull request #229 from apsherid/patch-1
Browse files Browse the repository at this point in the history
Prevent crash on null Map Projection
  • Loading branch information
markmcd committed Feb 15, 2016
2 parents 98514f4 + 269a101 commit a4562a2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ public void handleMessage(Message msg) {
// Nothing to do.
return;
}
Projection projection = mMap.getProjection();
if (projection == null) {
// Without a map projection we can't render clusters.
return;
}

RenderTask renderTask;
synchronized (this) {
Expand All @@ -278,7 +283,7 @@ public void run() {
sendEmptyMessage(TASK_FINISHED);
}
});
renderTask.setProjection(mMap.getProjection());
renderTask.setProjection(projection);
renderTask.setMapZoom(mMap.getCameraPosition().zoom);
new Thread(renderTask).start();
}
Expand Down

0 comments on commit a4562a2

Please sign in to comment.