fixed an NPE for null comments

This commit is contained in:
Maxmtg
2011-09-05 15:46:09 +00:00
parent ce5851ab5a
commit ef773c9d4c
2 changed files with 2 additions and 3 deletions

View File

@@ -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;
} }
/** /**

View File

@@ -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()) {