On Feb 12, 2009, at 08:18:44, f/ wrote:
> Apparently my thing hasn´t had the GROWL_APP_ID set in any place  
> (And I was not passing it explicitly).. but the application bridge  
> shouldn´t crash by that! should it?


Well, no, the framework shouldn't crash the app for any reason. ☺

Regarding your patch:

(I fixed the whitespace in your diff)
> -             if (!CFDictionaryContainsKey(mRegDict, GROWL_APP_ID))
> -                     CFDictionarySetValue(mRegDict, GROWL_APP_ID, 
> CFBundleGetIdentifier
> (CFBundleGetMainBundle()));
> -
> +             if (!CFDictionaryContainsKey(mRegDict, GROWL_APP_ID)){
> +                     CFTypeRef app_id = CFBundleGetIdentifier
> (CFBundleGetMainBundle());
> +                     if (!app_id){
> +                         app_id = CFStringCreateWithCString
> (kCFAllocatorDefault, "com.growl.unknown", kCFStringEncodingASCII);
> +                     NSLog(CFSTR("GrowlApplicationBridge: Could not
> determine GROWL_AP_ID from the registration dictionary nor the main
> application bundle (using %@)."),app_id);
> +                     }
> +                     CFDictionarySetValue(mRegDict, GROWL_APP_ID,app_id);
> +             }

We're not going to make up a bundle identifier for the app. If the app  
doesn't provide one and none exists, we should log a message and then  
abort registration.

Also, we should guard CFBundleGetMainBundle's return value as well. I  
believe it currently always returns an object, but I wouldn't want to  
count on that in the case of command-line tools.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Growl Discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/growldiscuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to