Fix null return value dereference CID 18162

This commit is contained in:
_aLfa_ 2014-11-22 12:30:51 +01:00
parent d9440afdb1
commit 0b01b11cce

View File

@ -38,12 +38,18 @@ namespace Nikse.SubtitleEdit.Forms
if (key.Length == 0 || value.Length == 0 || key == value)
return;
var languageString = LanguageString;
if (languageString == null)
{
return;
}
try
{
var ci = new CultureInfo(LanguageString.Replace("_", "-"));
var ci = new CultureInfo(languageString.Replace("_", "-"));
_threeLetterIsoLanguageName = ci.ThreeLetterISOLanguageName;
}
catch (Exception exception)
catch (CultureNotFoundException exception)
{
MessageBox.Show(exception.Message);
return;