rails/util/GameFileIO.java | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
New commits:
commit ee3e580ae2efdb10c28bdfe0565566e39f17491a
Author: Erik Vos <eri...@xs...>
Date: Fri Jun 15 13:48:48 2012 +0200
Fixed failure on reloading a null action list.
GameFileIO.replayGame() was not protected against that condition.
[IMO the list should have been created empty, not null; EV]
diff --git a/rails/util/GameFileIO.java b/rails/util/GameFileIO.java
index ec682df..cfb6ef3 100644
--- a/rails/util/GameFileIO.java
+++ b/rails/util/GameFileIO.java
@@ -219,13 +219,15 @@ public class GameFileIO {
gameManager.setReloading(true);
int count = -1;
- for (PossibleAction action : gameData.actions) {
- count++;
- if (!gameManager.processOnReload(action)) {
- log.error ("Load interrupted");
- DisplayBuffer.add(LocalText.getText("LoadInterrupted", count));
- ReportBuffer.add(LocalText.getText("LoadInterrupted", count));
- break;
+ if (gameData != null && gameData.actions != null) {
+ for (PossibleAction action : gameData.actions) {
+ count++;
+ if (!gameManager.processOnReload(action)) {
+ log.error ("Load interrupted");
+ DisplayBuffer.add(LocalText.getText("LoadInterrupted", count));
+ ReportBuffer.add(LocalText.getText("LoadInterrupted", count));
+ break;
+ }
}
}
|