Wait for currentMenu to be != null
(cherry picked from commit 13b96ec)
This commit is contained in:
parent
fd7f4ae145
commit
15bac4d386
|
@ -474,10 +474,12 @@ public class RuffyScripter {
|
||||||
|
|
||||||
// === pump ops ===
|
// === pump ops ===
|
||||||
public Menu getCurrentMenu() {
|
public Menu getCurrentMenu() {
|
||||||
// TODO workaround, supposedly fixed in latest ruffy?
|
long timeout = System.currentTimeMillis() + 5 * 1000;
|
||||||
while (currentMenu == null) {
|
while (currentMenu == null) {
|
||||||
|
if (System.currentTimeMillis() > timeout) {
|
||||||
|
throw new CommandException().message("Unable to read current menu");
|
||||||
|
}
|
||||||
log.error("currentMenu == null, waiting");
|
log.error("currentMenu == null, waiting");
|
||||||
SystemClock.sleep(500);
|
|
||||||
waitForMenuUpdate();
|
waitForMenuUpdate();
|
||||||
}
|
}
|
||||||
return currentMenu;
|
return currentMenu;
|
||||||
|
|
Loading…
Reference in a new issue