mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
This resolves an issue when hashing NON-existing cards.
Hash code now considers collectorNumber, which is retrieved from card edition, if not available. For non existing cards, the edition won't be found (null return) which resulted in a NPE. This patch addresses this situation. In future, this method will be removed, and PaperCard created directly with corresponding collectorNumber from CardInSet.
This commit is contained in:
@@ -308,6 +308,8 @@ public final class PaperCard implements Comparable<IPaperCard>, InventoryItemFro
|
|||||||
private String retrieveCollectorNumber() {
|
private String retrieveCollectorNumber() {
|
||||||
CardEdition.Collection editions = StaticData.instance().getEditions();
|
CardEdition.Collection editions = StaticData.instance().getEditions();
|
||||||
CardEdition edition = editions.get(this.edition);
|
CardEdition edition = editions.get(this.edition);
|
||||||
|
if (edition == null) // don't bother continuing - non-existing card!
|
||||||
|
return NO_COLLECTOR_NUMBER;
|
||||||
int artIndexCount = 0;
|
int artIndexCount = 0;
|
||||||
String collectorNumberInEdition = "";
|
String collectorNumberInEdition = "";
|
||||||
for (CardEdition.CardInSet card : edition.getAllCardsInSet()) {
|
for (CardEdition.CardInSet card : edition.getAllCardsInSet()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user