Merge branch 'fixnpe' into 'master'

Fix NPE

See merge request core-developers/forge!5141
This commit is contained in:
Michael Kamensky
2021-07-31 04:47:09 +00:00
13 changed files with 10 additions and 25 deletions

View File

@@ -414,7 +414,7 @@ public final class CardRules implements ICardCharacteristics {
String key = colonPos > 0 ? line.substring(0, colonPos) : line;
String value = colonPos > 0 ? line.substring(1+colonPos).trim() : null;
switch(key.charAt(0)) {
switch (key.charAt(0)) {
case 'A':
if ("A".equals(key)) {
this.faces[curFace].addAbility(value);

View File

@@ -759,7 +759,6 @@ public final class CardType implements Comparable<CardType>, CardTypeView {
};
}
///////// Utility methods
public static boolean isACardType(final String cardType) {
return CoreType.isValidEnum(cardType);

View File

@@ -40,7 +40,6 @@ public class PrintSheet {
private final ItemPool<PaperCard> cardsWithWeights;
private final String name;
public PrintSheet(String name0) {
this(name0, null);

View File

@@ -43,9 +43,8 @@ public class DeckGenPool implements IDeckGenPool {
Iterable<PaperCard> editionCards=Iterables.filter(cards.values(), filter);
if (editionCards.iterator().hasNext()){
return editionCards.iterator().next();
}else {
return getCard(name);
}
return getCard(name);
}
@Override

View File

@@ -3,9 +3,6 @@ package forge.item;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
/**
* Filtering conditions for miscellaneous InventoryItems.
*/

View File

@@ -349,4 +349,3 @@ public final class PaperCard implements Comparable<IPaperCard>, InventoryItemFro
|| (this.getName().equals("Mountain"));
}
}

View File

@@ -95,7 +95,7 @@ public class PaperToken implements InventoryItemFromSet, IPaperCard {
build.add(subtypes);
// Are these keywords sorted?
for(String keyword : rules.getMainPart().getKeywords()) {
for (String keyword : rules.getMainPart().getKeywords()) {
build.add(keyword);
}