mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* Fixed possible null pointer exception for add land dialog.
This commit is contained in:
parent
dda73f304e
commit
64176c1fa6
1 changed files with 6 additions and 4 deletions
|
@ -75,6 +75,7 @@ public class AddLandDialog extends MageDialog {
|
||||||
if (this.setCodesland.isEmpty()) {
|
if (this.setCodesland.isEmpty()) {
|
||||||
for (String setCode :deck.getExpansionSetCodes()) {
|
for (String setCode :deck.getExpansionSetCodes()) {
|
||||||
ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode);
|
ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode);
|
||||||
|
if (expansionInfo != null) {
|
||||||
ExpansionInfo [] blockSets = ExpansionRepository.instance.getSetsFromBlock(expansionInfo.getBlockName());
|
ExpansionInfo [] blockSets = ExpansionRepository.instance.getSetsFromBlock(expansionInfo.getBlockName());
|
||||||
for (ExpansionInfo blockSet: blockSets) {
|
for (ExpansionInfo blockSet: blockSets) {
|
||||||
if (blockSet.hasBasicLands()) {
|
if (blockSet.hasBasicLands()) {
|
||||||
|
@ -83,6 +84,7 @@ public class AddLandDialog extends MageDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// if still no set with lands found, take one by random
|
// if still no set with lands found, take one by random
|
||||||
if (this.setCodesland.isEmpty()) {
|
if (this.setCodesland.isEmpty()) {
|
||||||
// if sets have no basic lands and also it has no parent or parent has no lands get last set with lands
|
// if sets have no basic lands and also it has no parent or parent has no lands get last set with lands
|
||||||
|
|
Loading…
Reference in a new issue