From efae3b754fce5d623efc719972b6ba4a90f8d474 Mon Sep 17 00:00:00 2001 From: Louis Date: Sun, 23 May 2021 17:13:39 +0200 Subject: [PATCH] Fixed bug #62 --- .../sharer/GameplayFeatureSharer.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/lmh01/mgt2mt/data_stream/sharer/GameplayFeatureSharer.java b/src/main/java/com/github/lmh01/mgt2mt/data_stream/sharer/GameplayFeatureSharer.java index e2d20dbb..f16088d0 100644 --- a/src/main/java/com/github/lmh01/mgt2mt/data_stream/sharer/GameplayFeatureSharer.java +++ b/src/main/java/com/github/lmh01/mgt2mt/data_stream/sharer/GameplayFeatureSharer.java @@ -35,10 +35,24 @@ public String getOptionPaneMessage(Map map) { ArrayList badGenreIds = new ArrayList<>(); ArrayList goodGenreIds = new ArrayList<>(); for(String string : badGenreNames){ - badGenreIds.add(ModManager.genreMod.getAnalyzer().getContentIdByName(string)); + try{ + badGenreIds.add(Integer.parseInt(string)); + }catch(NumberFormatException e){ + int numberToAdd = ModManager.genreMod.getAnalyzer().getContentIdByName(string); + if(numberToAdd != -1){ + badGenreIds.add(numberToAdd); + } + } } for(String string : goodGenreNames){ - goodGenreIds.add(ModManager.genreMod.getAnalyzer().getContentIdByName(string)); + try{ + goodGenreIds.add(Integer.parseInt(string)); + }catch(NumberFormatException e){ + int numberToAdd = ModManager.genreMod.getAnalyzer().getContentIdByName(string); + if(numberToAdd != -1){ + goodGenreIds.add(numberToAdd); + } + } } map.remove("BAD"); map.remove("GOOD");