fix possible npe
This commit is contained in:
parent
f224b8b758
commit
946fb39693
1 changed files with 3 additions and 5 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue