From 5842fd34a57ec65a4e132d94560351d13dc2ded4 Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Mon, 2 Jan 2023 10:12:43 -0600 Subject: [PATCH] Fixing card importer not handling card lines without a "1x" or "x1" on them, which was most site and the RB/Ring --- .../src/main/java/com/gempukku/lotro/game/ImportCards.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/ImportCards.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/ImportCards.java index 8ebb79017..5aed3252c 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/ImportCards.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/ImportCards.java @@ -2,6 +2,7 @@ package com.gempukku.lotro.game; import com.gempukku.lotro.common.*; import com.gempukku.lotro.logic.GameUtils; +import com.google.common.base.Strings; import java.util.*; import java.util.regex.Pattern; @@ -86,10 +87,10 @@ public class ImportCards { var matches = cardLinePattern.matcher(line); if(matches.matches()) { - if(!matches.group(1).isBlank()) { + if(!Strings.isNullOrEmpty(matches.group(1))) { quantity = Integer.parseInt(matches.group(1).replaceAll("\\D+", "")); } - else if(!matches.group(3).isBlank()) { + else if(!Strings.isNullOrEmpty(matches.group(3))) { quantity = Integer.parseInt(matches.group(3).replaceAll("\\D+", "")); } else { @@ -100,7 +101,7 @@ public class ImportCards { result.add(new CardCount(SortAndFilterCards.replaceSpecialCharacters(cardLine).trim(), quantity)); } } catch (Exception exp) { - // Ignore the card + System.out.println("blah"); } } return result;