mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
fix npe parsing quest challenges without difficulty
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package forge.quest;
|
package forge.quest;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Write javadoc for this type.
|
* TODO: Write javadoc for this type.
|
||||||
*
|
*
|
||||||
@@ -21,6 +23,9 @@ public enum QuestEventDifficulty {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static QuestEventDifficulty fromString(String src) {
|
public static QuestEventDifficulty fromString(String src) {
|
||||||
|
if ( StringUtils.isBlank(src) )
|
||||||
|
return MEDIUM; // player have custom files, that didn't specify a valid difficulty
|
||||||
|
|
||||||
for(QuestEventDifficulty qd : QuestEventDifficulty.values()) {
|
for(QuestEventDifficulty qd : QuestEventDifficulty.values()) {
|
||||||
if( src.equalsIgnoreCase(qd.inFile) || src.equalsIgnoreCase(qd.name()) )
|
if( src.equalsIgnoreCase(qd.inFile) || src.equalsIgnoreCase(qd.name()) )
|
||||||
return qd;
|
return qd;
|
||||||
|
|||||||
Reference in New Issue
Block a user