Fixing server crash when a rarity is not provided for a card

This commit is contained in:
Christian 'ketura' McCarty
2021-01-22 12:40:51 -06:00
parent 68d35845dc
commit 6ed561b89a

View File

@@ -142,6 +142,11 @@ public class SortAndFilterCards {
SetDefinition setRarity = rarities.get(blueprintId.substring(0, blueprintId.indexOf("_")));
if (setRarity != null) {
String cardRarity = setRarity.getCardRarity(library.stripBlueprintModifiers(blueprintId));
if(cardRarity == null) {
//TODO: log that the rarity was not set
//real TODO: put the rarity in the friggin json
return false;
}
for (String r : rarity) {
if (cardRarity.equals(r))
return true;