mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
deckmanager crashed on bad files
This commit is contained in:
@@ -373,7 +373,7 @@ public class DeckManager {
|
||||
|
||||
//readDeck comments
|
||||
String comment = null;
|
||||
while ((line = iterator.next()) != null && !line.equals("[general]")) {
|
||||
while (iterator.hasNext() && (line = iterator.next()) != null && !line.equals("[general]")) {
|
||||
if (comment == null) {
|
||||
comment = line;
|
||||
} else {
|
||||
@@ -382,7 +382,8 @@ public class DeckManager {
|
||||
}
|
||||
|
||||
//readDeck deck type
|
||||
GameType deckType = GameType.smartValueOf(iterator.next());
|
||||
|
||||
GameType deckType = iterator.hasNext() ? GameType.smartValueOf(iterator.next()) : GameType.Constructed;
|
||||
|
||||
d.setName(name);
|
||||
d.setComment(comment);
|
||||
|
||||
Reference in New Issue
Block a user