grade can be null
This commit is contained in:
@@ -43,7 +43,7 @@ public class CombatZones {
|
||||
/// Returns the given combat zone difficulty as an integer, so it can be sorted.
|
||||
/// 0 = lowest difficulty, 1 = medium and so forth.
|
||||
/// </summary>
|
||||
public static int? DifficultyRank(string difficulty) {
|
||||
public static int? DifficultyRank(string? difficulty) {
|
||||
Dictionary<string, int> ranks = new() {
|
||||
{ DifficultyLow, 0 },
|
||||
{ DifficultyMedium, 1 },
|
||||
@@ -51,6 +51,10 @@ public class CombatZones {
|
||||
{ DifficultyVeryHigh, 3 }
|
||||
};
|
||||
|
||||
if (difficulty == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (ranks.TryGetValue(difficulty, out int rank)) {
|
||||
return rank;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user