mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +00:00
ManaEffect > getStackDescription() try to dodge NPE
This commit is contained in:
@@ -270,9 +270,14 @@ public class ManaEffect extends SpellAbilityEffect {
|
|||||||
? GameActionUtil.generatedMana(sa) : "mana";
|
? GameActionUtil.generatedMana(sa) : "mana";
|
||||||
sb.append("Add ").append(toManaString(mana)).append(".");
|
sb.append("Add ").append(toManaString(mana)).append(".");
|
||||||
if (sa.hasParam("RestrictValid")) {
|
if (sa.hasParam("RestrictValid")) {
|
||||||
String desc = sa.getDescription();
|
sb.append(" ");
|
||||||
int i = desc.indexOf("Spend this");
|
final String desc = sa.getDescription();
|
||||||
sb.append(" ").append(desc, i, desc.indexOf(".", i) + 1);
|
if (desc.contains("Spend this") && desc.contains(".")) {
|
||||||
|
int i = desc.indexOf("Spend this");
|
||||||
|
sb.append(desc, i, desc.indexOf(".", i) + 1);
|
||||||
|
} else {
|
||||||
|
sb.append("[failed to add RestrictValid to StackDesc]");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user