Bug 1514605 - fix Thunderbird startup crash when GTK_USE_PORTAL=1 is set. r+a=jorgk
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Tue, 10 Sep 2019 16:42:22 +0300
changeset 35799 d741c4f6b95c5f3e063738d171b2fccea3695263
parent 35798 bbbd494153b720c3d441060e08a510063379445d
child 35800 9767acaec457b304aba9c26af5b050b139153814
push id27
push usermozilla@jorgk.com
push dateThu, 12 Sep 2019 13:15:14 +0000
treeherdercomm-esr68@5fa4de11c596 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1514605
Bug 1514605 - fix Thunderbird startup crash when GTK_USE_PORTAL=1 is set. r+a=jorgk
mail/components/shell/nsGNOMEShellService.cpp
--- a/mail/components/shell/nsGNOMEShellService.cpp
+++ b/mail/components/shell/nsGNOMEShellService.cpp
@@ -207,17 +207,20 @@ bool nsGNOMEShellService::checkDefault(c
     if (giovfs) {
       handler.Truncate();
       nsCOMPtr<nsIHandlerApp> handlerApp;
       rv = giovfs->GetAppForURIScheme(nsDependentCString(aProtocols[i]),
                                       getter_AddRefs(handlerApp));
       if (NS_FAILED(rv) || !handlerApp) {
         return false;
       }
-      nsCOMPtr<nsIGIOMimeApp> app = do_QueryInterface(handlerApp);
+      nsCOMPtr<nsIGIOMimeApp> app = do_QueryInterface(handlerApp, &rv);
+      if (NS_FAILED(rv) || !app) {
+        return false;
+      }
       rv = app->GetCommand(handler);
       if (NS_SUCCEEDED(rv) && !CheckHandlerMatchesAppName(handler)) {
         return false;
       }
     }
   }
 
   return true;