Merge branch 'master' into 'master'

NPE guard when generating description in DamageDealEffect.

See merge request core-developers/forge!5827
This commit is contained in:
Michael Kamensky
2021-11-14 04:52:34 +00:00

View File

@@ -123,7 +123,7 @@ public class DamageDealEffect extends DamageBaseEffect {
stringBuilder.append("."); stringBuilder.append(".");
if (spellAbility.hasParam("ReplaceDyingDefined")) { if (spellAbility.hasParam("ReplaceDyingDefined")) {
String statement = "If that creature would die this turn, exile it instead."; String statement = "If that creature would die this turn, exile it instead.";
String[] sentences = spellAbility.getParam("SpellDescription").split("\\."); String[] sentences = spellAbility.getParamOrDefault("SpellDescription", "").split("\\.");
for (String s : sentences) { for (String s : sentences) {
if (s.contains("would die")) { if (s.contains("would die")) {
statement = s; statement = s;