Don't crash if language detection fails, but leave a warning. This should be fixed properly at some point (in particular, it is reported to fail for systems using Czech)

This commit is contained in:
Colby Klein
2011-12-26 09:19:37 -08:00
parent 4b9ceb4bbf
commit d5edc4dd9c
+5 -1
View File
@@ -343,7 +343,11 @@ RString ArchHooks::GetPreferredLanguage()
{
// MacRoman agrees with ASCII in the low-order 7 bits.
const char *str = CFStringGetCStringPtr( lang, kCFStringEncodingMacRoman );
ASSERT( str );
if( str )
ret = str;
else
LOG->Warn( "Unable to determine system language. Using English." );
ret = RString( str, 2 );
}