Fix following exception at game end:

java.lang.RuntimeException: Cannot remove input InputPayManaOfCostPayment because it's not on top of stack. Stack = []
	at forge.match.input.InputQueue.removeInput(InputQueue.java:60)
	at forge.match.input.InputSyncronizedBase.stop(InputSyncronizedBase.java:49)
	at forge.match.input.InputPayMana.onStateChanged(InputPayMana.java:431)
	at forge.match.input.InputPayMana$3.run(InputPayMana.java:382)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
This commit is contained in:
Myrd
2015-01-10 01:50:56 +00:00
parent ed2bfcc295
commit dc3f487d6b

View File

@@ -46,7 +46,9 @@ public abstract class InputSyncronizedBase extends InputBase implements InputSyn
});
// thread irrelevant
getController().getInputQueue().removeInput(InputSyncronizedBase.this);
if (getController().getInputQueue().getInput() != null) {
getController().getInputQueue().removeInput(InputSyncronizedBase.this);
}
cdlDone.countDown();
}