Fix NPE in KeywordsChange.

This commit is contained in:
elcnesh
2014-08-17 07:32:24 +00:00
parent bd80c4c706
commit 12b0aa8e40

View File

@@ -17,7 +17,6 @@
*/ */
package forge.game; package forge.game;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
@@ -31,27 +30,21 @@ import com.google.common.collect.Lists;
* @version $Id$ * @version $Id$
*/ */
public class KeywordsChange { public class KeywordsChange {
// takes care of individual card types private final List<String> keywords;
private List<String> keywords = new ArrayList<String>(); private final List<String> removeKeywords;
private List<String> removeKeywords = new ArrayList<String>(); private final boolean removeAllKeywords;
private boolean removeAllKeywords = false;
/** /**
* *
* Card_Keywords. * Construct a new {@link KeywordsChange}.
* *
* @param keywordList * @param keywordList the list of keywords to add.
* an ArrayList<String> * @param removeKeywordList the list of keywords to remove.
* @param removeKeywordList * @param removeAll whether to remove all keywords.
* a ArrayList<String>
* @param removeAll
* a boolean
* @param stamp
* a long
*/ */
public KeywordsChange(final List<String> keywordList, final List<String> removeKeywordList, final boolean removeAll) { public KeywordsChange(final List<String> keywordList, final List<String> removeKeywordList, final boolean removeAll) {
this.keywords = Lists.newArrayList(keywordList); this.keywords = keywordList == null ? Lists.<String>newArrayList() : Lists.newArrayList(keywordList);
this.removeKeywords = Lists.newArrayList(removeKeywordList); this.removeKeywords = removeKeywordList == null ? Lists.<String>newArrayList() : Lists.newArrayList(removeKeywordList);
this.removeAllKeywords = removeAll; this.removeAllKeywords = removeAll;
} }