Fixes an uninitialized-variable case that could cause #178. maintenance-1.2
authorPeter Hosey <hg@boredzo.org>
Thu Mar 10 18:39:10 2011 -0800 (2011-03-10)
branchmaintenance-1.2
changeset 467451b12f1c6556
parent 4673 03bcd13b55b8
child 4675 928f32c47c16
Fixes an uninitialized-variable case that could cause #178.
Framework/Source/GrowlApplicationBridge.m
     1.1 --- a/Framework/Source/GrowlApplicationBridge.m	Thu Feb 10 23:53:05 2011 -0800
     1.2 +++ b/Framework/Source/GrowlApplicationBridge.m	Thu Mar 10 18:39:10 2011 -0800
     1.3 @@ -790,7 +790,7 @@
     1.4  }
     1.5  + (BOOL) _launchGrowlIfInstalledWithRegistrationDictionary:(NSDictionary *)regDict {
     1.6  	BOOL success = NO;
     1.7 -	NSBundle *growlPrefPaneBundle;
     1.8 +	NSBundle *growlPrefPaneBundle = nil;
     1.9  	NSString *growlHelperAppPath;
    1.10  
    1.11  	//First look for a running GHA. It might not actually be within a Growl prefpane bundle.
    1.12 @@ -803,14 +803,17 @@
    1.13  		//Make sure we actually got a Growl.prefPane and not, say, a Growl project folder. (NSBundle can be liberal in its acceptance of a directory as a bundle at times.)
    1.14  		if (![[growlPrefPaneBundle bundleIdentifier] isEqualToString:GROWL_PREFPANE_BUNDLE_IDENTIFIER])
    1.15  			growlPrefPaneBundle = nil;
    1.16 -	} else {
    1.17 +	}
    1.18 +	//If we didn't get a Growl prefpane bundle by finding the bundle that contained GHA, look it up directly.
    1.19 +	if (!growlPrefPaneBundle) {
    1.20 +		growlPrefPaneBundle = [GrowlPathUtilities growlPrefPaneBundle];
    1.21 +	}
    1.22 +	//If we don't already have the path to a running GHA, then…
    1.23 +	if (!growlHelperAppPath) {
    1.24  		//Look for an installed-but-not-running GHA.
    1.25  		growlHelperAppPath = [growlPrefPaneBundle pathForResource:@"GrowlHelperApp"
    1.26  														   ofType:@"app"];
    1.27  	}
    1.28 -	if (!growlPrefPaneBundle) {
    1.29 -		growlPrefPaneBundle = [GrowlPathUtilities growlPrefPaneBundle];
    1.30 -	}
    1.31  
    1.32  #ifdef GROWL_WITH_INSTALLER
    1.33  	if (growlPrefPaneBundle) {