mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 01:38:13 +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";
|
||||
sb.append("Add ").append(toManaString(mana)).append(".");
|
||||
if (sa.hasParam("RestrictValid")) {
|
||||
String desc = sa.getDescription();
|
||||
int i = desc.indexOf("Spend this");
|
||||
sb.append(" ").append(desc, i, desc.indexOf(".", i) + 1);
|
||||
sb.append(" ");
|
||||
final String desc = sa.getDescription();
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user