bug 844454 - don't try to get a Unicode decoder for an empty charset name. r=hsivonen

This commit is contained in:
Jonathan Kew 2013-02-25 15:56:19 +00:00
parent 08ef823f28
commit 3c10c07d3e

View File

@ -1025,7 +1025,8 @@ nsScriptLoader::ConvertToUTF16(nsIChannel* aChannel, const uint8_t* aData,
if (!unicodeDecoder &&
aChannel &&
NS_SUCCEEDED(aChannel->GetContentCharset(charset))) {
NS_SUCCEEDED(aChannel->GetContentCharset(charset)) &&
!charset.IsEmpty()) {
charsetConv->GetUnicodeDecoder(charset.get(),
getter_AddRefs(unicodeDecoder));
}