mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
fixed an NPE for null comments
This commit is contained in:
@@ -152,8 +152,7 @@ public final class Deck implements Comparable<Deck>, Serializable {
|
|||||||
* @return a {@link java.lang.String} object.
|
* @return a {@link java.lang.String} object.
|
||||||
*/
|
*/
|
||||||
public String getComment() {
|
public String getComment() {
|
||||||
return comment;
|
return comment == null ? "" : comment;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -469,8 +469,8 @@ public class DeckManager {
|
|||||||
|
|
||||||
out.write(format("%s=%s%n", NAME, d.getName().replaceAll("\n", "")));
|
out.write(format("%s=%s%n", NAME, d.getName().replaceAll("\n", "")));
|
||||||
out.write(format("%s=%s%n", DECK_TYPE, d.getDeckType().replaceAll("\n", "")));
|
out.write(format("%s=%s%n", DECK_TYPE, d.getDeckType().replaceAll("\n", "")));
|
||||||
out.write(format("%s=%s%n", PLAYER, d.getPlayerType()));
|
|
||||||
out.write(format("%s=%s%n", COMMENT, d.getComment().replaceAll("\n", "")));
|
out.write(format("%s=%s%n", COMMENT, d.getComment().replaceAll("\n", "")));
|
||||||
|
out.write(format("%s=%s%n", PLAYER, d.getPlayerType()));
|
||||||
|
|
||||||
out.write(format("%s%n", "[main]"));
|
out.write(format("%s%n", "[main]"));
|
||||||
for (Entry<CardPrinted, Integer> e : d.getMain()) {
|
for (Entry<CardPrinted, Integer> e : d.getMain()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user