Bug 1352348 - don't do registry lookups for empty strings passed when we want to know a mimetype, r=Paolo

MozReview-Commit-ID: KZ9w7zMZ35g

--HG--
extra : rebase_source : 9913c46ebc885ee2de815811bfcb6a39a88f0d71
This commit is contained in:
Gijs Kruitbosch 2017-04-13 15:46:45 +01:00
parent c5f0b243ca
commit 1da74eafa7

View File

@ -504,7 +504,8 @@ already_AddRefed<nsIMIMEInfo> nsOSHelperAppService::GetMIMEInfoFromOS(const nsAC
* useless....
* We'll do extension-based lookup for this type later in this function.
*/
if (!aMIMEType.LowerCaseEqualsLiteral(APPLICATION_OCTET_STREAM)) {
if (!aMIMEType.IsEmpty() &&
!aMIMEType.LowerCaseEqualsLiteral(APPLICATION_OCTET_STREAM)) {
// (1) try to use the windows mime database to see if there is a mapping to a file extension
// (2) try to see if we have some left over 4.x registry info we can peek at...
GetExtensionFromWindowsMimeDatabase(aMIMEType, fileExtension);