mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- NPE prevention in CardDetailUtil.
This commit is contained in:
@@ -300,30 +300,33 @@ public class CardDetailUtil {
|
|||||||
// text changes
|
// text changes
|
||||||
final Map<String, String> changedColorWords = card.getChangedColorWords();
|
final Map<String, String> changedColorWords = card.getChangedColorWords();
|
||||||
final Map<String, String> changedTypes = card.getChangedTypes();
|
final Map<String, String> changedTypes = card.getChangedTypes();
|
||||||
if (!(changedColorWords.isEmpty() && changedTypes.isEmpty())) {
|
if (changedColorWords != null && changedTypes != null) {
|
||||||
if (area.length() != 0) {
|
if (!(changedColorWords.isEmpty() && changedTypes.isEmpty())) {
|
||||||
area.append("\n");
|
if (area.length() != 0) {
|
||||||
}
|
area.append("\n");
|
||||||
}
|
}
|
||||||
for (final Entry<String, String> e : Sets.union(changedColorWords.entrySet(), changedTypes.entrySet())) {
|
}
|
||||||
// ignore lower case and plural form keys, to avoid duplicity
|
|
||||||
if (Character.isUpperCase(e.getKey().charAt(0)) &&
|
for (final Entry<String, String> e : Sets.union(changedColorWords.entrySet(), changedTypes.entrySet())) {
|
||||||
!CardUtil.singularTypes.containsKey(e.getKey())) {
|
// ignore lower case and plural form keys, to avoid duplicity
|
||||||
area.append("Text changed: all instances of ");
|
if (Character.isUpperCase(e.getKey().charAt(0))
|
||||||
if (e.getKey().equals("Any")) {
|
&& !CardUtil.singularTypes.containsKey(e.getKey())) {
|
||||||
if (changedColorWords.containsKey(e.getKey())) {
|
area.append("Text changed: all instances of ");
|
||||||
area.append("color words");
|
if (e.getKey().equals("Any")) {
|
||||||
} else if (forge.card.CardType.getBasicTypes().contains(e.getValue())) {
|
if (changedColorWords.containsKey(e.getKey())) {
|
||||||
area.append("basic land types");
|
area.append("color words");
|
||||||
} else {
|
} else if (forge.card.CardType.getBasicTypes().contains(e.getValue())) {
|
||||||
area.append("creature types");
|
area.append("basic land types");
|
||||||
}
|
} else {
|
||||||
} else {
|
area.append("creature types");
|
||||||
area.append(e.getKey());
|
}
|
||||||
|
} else {
|
||||||
|
area.append(e.getKey());
|
||||||
|
}
|
||||||
|
area.append(" are replaced by ");
|
||||||
|
area.append(e.getValue());
|
||||||
|
area.append(".\n");
|
||||||
}
|
}
|
||||||
area.append(" are replaced by ");
|
|
||||||
area.append(e.getValue());
|
|
||||||
area.append(".\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user