mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-23 11:31:33 +01:00
Fix potential NPE in startup guide
DroidFish.reInitUI() could potentially set tourGuide to null while tap events are already queued but not yet processed. Avoid NPE in this situation.
This commit is contained in:
parent
0dd276ba22
commit
f463990029
|
@ -680,14 +680,19 @@ public class DroidFish extends Activity
|
|||
Editor editor = settings.edit();
|
||||
editor.putBoolean("guideShowOnStart", false);
|
||||
editor.apply();
|
||||
tourGuide.next();
|
||||
tourGuide = null;
|
||||
if (tourGuide != null) {
|
||||
tourGuide.next();
|
||||
tourGuide = null;
|
||||
}
|
||||
}));
|
||||
|
||||
Sequence sequence = new Sequence.SequenceBuilder()
|
||||
.add(guides.toArray(new TourGuide[0]))
|
||||
.setDefaultOverlay(new Overlay()
|
||||
.setOnClickListener(v -> tourGuide.next()))
|
||||
.setOnClickListener(v -> {
|
||||
if (tourGuide != null)
|
||||
tourGuide.next();
|
||||
}))
|
||||
.setDefaultPointer(new Pointer())
|
||||
.setContinueMethod(Sequence.ContinueMethod.OverlayListener)
|
||||
.build();
|
||||
|
|
Loading…
Reference in New Issue
Block a user