From e95d5a4fb9fc40d4db2b71489254cf072bf46bdc Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 23 Mar 2005 21:39:39 +0000 Subject: [PATCH] Fix some .getFromTypeAndExtension to follow the api documentation. Bug 274339, r=biesi,mconnor, sr=neil git-svn-id: svn://10.0.0.236/trunk@171131 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/toolkit/content/contentAreaUtils.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mozilla/toolkit/content/contentAreaUtils.js b/mozilla/toolkit/content/contentAreaUtils.js index dd2691c9dac..57063dea738 100644 --- a/mozilla/toolkit/content/contentAreaUtils.js +++ b/mozilla/toolkit/content/contentAreaUtils.js @@ -721,10 +721,12 @@ function getMIMETypeForURI(aURI) function getMIMEInfoForType(aMIMEType, aExtension) { - try { - return getMIMEService().getFromTypeAndExtension(aMIMEType, aExtension); - } - catch (e) { + if (aMIMEType || aExtension) { + try { + return getMIMEService().getFromTypeAndExtension(aMIMEType, aExtension); + } + catch (e) { + } } return null; }