Bug 1340803 - Make nsMIMEInfoWin::GetPossibleLocalHandlers check fileExt is non-empty before checking its first char. r=jimm

--HG--
extra : rebase_source : a3d43e53ddd9f0b5d084434bad88ac0463f8686f
This commit is contained in:
Honza Bambas 2017-02-18 07:31:00 -05:00
parent 08c7d6f388
commit 6db3552e69

View File

@ -612,8 +612,9 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray **_retval)
} }
nsAutoString fileExtToUse; nsAutoString fileExtToUse;
if (fileExt.First() != '.') if (!fileExt.IsEmpty() && fileExt.First() != '.') {
fileExtToUse = char16_t('.'); fileExtToUse = char16_t('.');
}
fileExtToUse.Append(NS_ConvertUTF8toUTF16(fileExt)); fileExtToUse.Append(NS_ConvertUTF8toUTF16(fileExt));
// Note, the order in which these occur has an effect on the // Note, the order in which these occur has an effect on the