mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
*Fix potential NPE in Commander deck conformance check.
This commit is contained in:
@@ -170,20 +170,23 @@ public enum DeckFormat {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(Entry<CardPrinted, Integer> cp : deck.get(DeckSection.Sideboard)) {
|
if(deck.get(DeckSection.Sideboard) != null)
|
||||||
if(!cp.getKey().getRules().getColorIdentity().hasNoColorsExcept(cmdCI.getColor()))
|
{
|
||||||
{
|
for(Entry<CardPrinted, Integer> cp : deck.get(DeckSection.Sideboard)) {
|
||||||
erroneousCI.add(cp.getKey());
|
if(!cp.getKey().getRules().getColorIdentity().hasNoColorsExcept(cmdCI.getColor()))
|
||||||
}
|
|
||||||
if(cp.getKey().getRules().getType().isLand())
|
|
||||||
{
|
|
||||||
for(String key : Constant.Color.COLOR_TO_BASIC_LAND_TYPE_MAP.keySet())
|
|
||||||
{
|
{
|
||||||
if(!cmdCI.hasAnyColor(MagicColor.fromName(key)))
|
erroneousCI.add(cp.getKey());
|
||||||
|
}
|
||||||
|
if(cp.getKey().getRules().getType().isLand())
|
||||||
|
{
|
||||||
|
for(String key : Constant.Color.COLOR_TO_BASIC_LAND_TYPE_MAP.keySet())
|
||||||
{
|
{
|
||||||
if(cp.getKey().getRules().getType().subTypeContains(Constant.Color.COLOR_TO_BASIC_LAND_TYPE_MAP.get(key)))
|
if(!cmdCI.hasAnyColor(MagicColor.fromName(key)))
|
||||||
{
|
{
|
||||||
erroneousCI.add(cp.getKey());
|
if(cp.getKey().getRules().getType().subTypeContains(Constant.Color.COLOR_TO_BASIC_LAND_TYPE_MAP.get(key)))
|
||||||
|
{
|
||||||
|
erroneousCI.add(cp.getKey());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user