Bug 547898 - Null check osxDirectory to stop crashes. r=smichaud,a=Standard8
authorJosiah Bruner <josiah@programmer.net>
Fri, 25 Oct 2013 12:45:26 -0400
changeset 16108 41aefb13384e6b14a916c3ca17f2006b03a7a053
parent 16105 51447af3c1f5121ede42239f60c07f6d6ba509c6
child 16109 bf8afdbae33a3330a870942b1c0cb9570c1e0292
child 16111 c9e225453232a346f499846ee1a5f927e6e9a796
child 16112 36d3c6de151008fbc02879f6335bdfe81ac446a1
child 16114 a908efbe7f74793bf9e1c4fd59b43840bc1ea69b
child 16116 f035562feb290087e3dfe388ed10770c88a788b9
child 16119 bb189b79a6348c23806247ea164d41a56d1e1332
child 16121 44eaa4af8bfee71510a78f77281d8ce52c39ec4c
child 16124 cde960c76a8696cd065111c3338bb8370ea3f91f
push id57
push usermbanner@mozilla.com
push dateFri, 06 Jun 2014 11:43:05 +0000
reviewerssmichaud, Standard8
bugs547898
Bug 547898 - Null check osxDirectory to stop crashes. r=smichaud,a=Standard8
mailnews/addrbook/src/nsAbOSXDirectory.mm
--- a/mailnews/addrbook/src/nsAbOSXDirectory.mm
+++ b/mailnews/addrbook/src/nsAbOSXDirectory.mm
@@ -104,17 +104,19 @@ Sync(NSString *aUid)
   ABRecord *card = [addressBook recordForUniqueId:aUid];
   if ([card isKindOfClass:[ABGroup class]])
   {
     nsCOMPtr<nsIAbDirectory> directory;
     GetOrCreateGroup(aUid, getter_AddRefs(directory));
     nsCOMPtr<nsIAbOSXDirectory> osxDirectory =
       do_QueryInterface(directory);
     
-    osxDirectory->Update();
+    if (osxDirectory) {
+      osxDirectory->Update();
+    }
   }
   else {
     nsCOMPtr<nsIAbCard> abCard;
     nsresult rv;
 
     nsCOMPtr<nsIAbManager> abManager = do_GetService(NS_ABMANAGER_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);