Skip to content

Commit 4d39586

Browse files
committed
Throw error when invalid locale is detected
1 parent e518b3a commit 4d39586

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

WowPacketParser/Misc/ClientLocale.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public static void SetLocale(string locale)
2525
PacketLocaleString = "enUS";
2626
else
2727
PacketLocaleString = locale;
28+
29+
if (!Enum.TryParse<LocaleConstant>(PacketLocaleString, out var _))
30+
throw new InvalidDataException($"Invalid locale '{PacketLocaleString}'.");
2831
}
2932
}
3033
}

0 commit comments

Comments
 (0)