Fix weird crash with bogus reason if deckfile does not exists (now it shows that deck is invalid).

master
Bilbo 2018-10-28 05:09:33 +01:00 committed by Melvin Zhang
parent 5aaa5ddc02
commit 91668c2964
1 changed files with 1 additions and 1 deletions

View File

@ -197,7 +197,7 @@ public class DeckUtils {
*/
public static MagicDeck loadDeckFromFile(final Path deckFilePath) {
if (deckFilePath == null || !deckFilePath.toFile().exists()) {
return new MagicDeck();
throw new InvalidDeckException("File " + deckFilePath + " does not exist");
}
final List<String> lines = getDeckFileContent(deckFilePath.toString());
final MagicDeck deck = DeckParser.parseLines(lines);