Wait for currentMenu to be != null

(cherry picked from commit 13b96ec)
This commit is contained in:
Johannes Mockenhaupt 2017-09-06 11:02:35 +02:00
parent fd7f4ae145
commit 15bac4d386
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -474,10 +474,12 @@ public class RuffyScripter {
// === pump ops ===
public Menu getCurrentMenu() {
// TODO workaround, supposedly fixed in latest ruffy?
long timeout = System.currentTimeMillis() + 5 * 1000;
while (currentMenu == null) {
if (System.currentTimeMillis() > timeout) {
throw new CommandException().message("Unable to read current menu");
}
log.error("currentMenu == null, waiting");
SystemClock.sleep(500);
waitForMenuUpdate();
}
return currentMenu;