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