Skip to content

Commit ba96f0e

Browse files
committed
Bug fix
1 parent b3e5e8e commit ba96f0e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Entities/Multilingual.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9394,6 +9394,7 @@ public static string GetCurrentLanguage() {
93949394
return lang;
93959395
}
93969396
public static string GetWord(string keyword) {
9397+
if (string.IsNullOrEmpty(keyword)) return String.Empty;
93979398
string word = string.Empty;
93989399
MultilingualDictionary.TryGetValue(GetCurrentLanguage(), out Dictionary<string, string> wordsDictionary);
93999400
wordsDictionary?.TryGetValue(keyword, out word);
@@ -9415,25 +9416,29 @@ public static string GetWordWithLang(string keyword, int lang) {
94159416
return word;
94169417
}
94179418
public static string GetWordWithLang(string keyword, string lang) {
9419+
if (string.IsNullOrEmpty(keyword)) return String.Empty;
94189420
string word = string.Empty;
94199421
MultilingualDictionary.TryGetValue(lang, out Dictionary<string, string> wordsDictionary);
94209422
wordsDictionary?.TryGetValue(keyword, out word);
94219423
return word;
94229424
}
94239425
public static string GetRoundName(string keyword) {
9426+
if (string.IsNullOrEmpty(keyword)) return String.Empty;
94249427
string name = string.Empty;
94259428
MultilingualRoundsDictionary.TryGetValue(GetCurrentLanguage(), out Dictionary<string, string> roundDictionary);
94269429
roundDictionary?.TryGetValue(keyword, out name);
94279430
if (string.IsNullOrEmpty(name)) { name = keyword; }
94289431
return name;
94299432
}
94309433
public static string GetShowName(string keyword) {
9434+
if (string.IsNullOrEmpty(keyword)) return String.Empty;
94319435
string name = string.Empty;
94329436
MultilingualShowsDictionary.TryGetValue(GetCurrentLanguage(), out Dictionary<string, string> showsDictionary);
94339437
showsDictionary?.TryGetValue(keyword, out name);
94349438
return name;
94359439
}
94369440
public static string GetCountryName(string keyword) {
9441+
if (string.IsNullOrEmpty(keyword)) return String.Empty;
94379442
string name = string.Empty;
94389443
MultilingualCountryDictionary.TryGetValue(GetCurrentLanguage(), out Dictionary<string, string> countryDictionary);
94399444
countryDictionary?.TryGetValue(keyword, out name);

Views/LevelDetails.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,10 @@ private void gridDetails_ColumnHeaderMouseClick(object sender, DataGridViewCellM
536536
showCompare = one.ShowID.CompareTo(two.ShowID);
537537
return showCompare != 0 ? showCompare : roundCompare;
538538
case "ShowNameId":
539-
int showNameCompare = (string.IsNullOrEmpty(one.ShowNameId) ? @" " : Multilingual.GetShowName(one.ShowNameId)).CompareTo(string.IsNullOrEmpty(two.ShowNameId) ? @" " : Multilingual.GetShowName(two.ShowNameId));
540-
return showNameCompare != 0 ? showNameCompare : roundCompare;
539+
string showNameIdOne = Multilingual.GetShowName(one.ShowNameId) ?? @" ";
540+
string showNameIdTwo = Multilingual.GetShowName(two.ShowNameId) ?? @" ";
541+
int showNameIdCompare = showNameIdOne.CompareTo(showNameIdTwo);
542+
return showNameIdCompare != 0 ? showNameIdCompare : roundCompare;
541543
case "Round":
542544
roundCompare = one.Round.CompareTo(two.Round);
543545
return roundCompare == 0 ? showCompare : roundCompare;

0 commit comments

Comments
 (0)