Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ namespace winrt::Microsoft::Windows::Globalization::implementation

void ApplicationLanguages::PrimaryLanguageOverride(hstring const& language)
{
bool isValidLanguageTag = IsWellFormedTag(language.c_str());
// Allow empty string to clear the override, otherwise validate the language tag
bool isValidLanguageTag = language.empty() || IsWellFormedTag(language.c_str());

THROW_HR_IF_MSG(E_INVALIDARG, !isValidLanguageTag, "The parameter is incorrect");

Expand Down