mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- NPE prevention in CardDetailUtil.
This commit is contained in:
@@ -300,15 +300,17 @@ public class CardDetailUtil {
|
||||
// text changes
|
||||
final Map<String, String> changedColorWords = card.getChangedColorWords();
|
||||
final Map<String, String> changedTypes = card.getChangedTypes();
|
||||
if (changedColorWords != null && changedTypes != null) {
|
||||
if (!(changedColorWords.isEmpty() && changedTypes.isEmpty())) {
|
||||
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)) &&
|
||||
!CardUtil.singularTypes.containsKey(e.getKey())) {
|
||||
if (Character.isUpperCase(e.getKey().charAt(0))
|
||||
&& !CardUtil.singularTypes.containsKey(e.getKey())) {
|
||||
area.append("Text changed: all instances of ");
|
||||
if (e.getKey().equals("Any")) {
|
||||
if (changedColorWords.containsKey(e.getKey())) {
|
||||
@@ -326,6 +328,7 @@ public class CardDetailUtil {
|
||||
area.append(".\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// counter text
|
||||
if (card.getCounters() != null) {
|
||||
|
||||
Reference in New Issue
Block a user