fix possible npe

This commit is contained in:
Victor Shcherb 2017-05-29 22:29:09 +02:00
parent f224b8b758
commit 946fb39693

View file

@ -102,13 +102,11 @@ public class AnimateDraggingMapThread {
public synchronized void startThreadAnimating(final Runnable runnable){ public synchronized void startThreadAnimating(final Runnable runnable){
stopAnimatingSync(); stopAnimatingSync();
stopped = false; stopped = false;
final Thread[] t = new Thread[1]; final Thread t = new Thread(new Runnable() {
t[0] = new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
try { try {
currentThread = t[0];
suspendUpdate(); suspendUpdate();
runnable.run(); runnable.run();
} finally { } finally {
@ -117,8 +115,8 @@ public class AnimateDraggingMapThread {
} }
} }
}, "Animating Thread"); }, "Animating Thread");
t[0].start(); currentThread = t;
t.start();
} }
public void startMoving(final double finalLat, final double finalLon, final Pair<Integer, Double> finalZoom, public void startMoving(final double finalLat, final double finalLon, final Pair<Integer, Double> finalZoom,