* MWSDeckImporter - Fixed bug that could find the wrong card (fixes #609).

This commit is contained in:
LevelX2 2014-10-27 20:47:02 +01:00
parent 74e0f76b1a
commit 4a2be2c3e6

View file

@ -63,16 +63,16 @@ public class MWSDeckImporter extends DeckImporter {
String lineName = line.substring(delim + 1).trim();
try {
int num = Integer.parseInt(lineNum);
CardCriteria criteria = new CardCriteria();
criteria.name(lineName);
criteria.setCodes(setCode);
List<CardInfo> cards = CardRepository.instance.findCards(criteria);
if (cards.isEmpty()) {
criteria = new CardCriteria();
List<CardInfo> cards = null;
if (!setCode.isEmpty()) {
CardCriteria criteria = new CardCriteria();
criteria.name(lineName);
criteria.setCodes(setCode);
cards = CardRepository.instance.findCards(criteria);
}
if (cards == null || cards.isEmpty()) {
cards = CardRepository.instance.findCards(lineName);
}
if (cards.isEmpty()) {
sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n");