mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Safer work with NSConnection
This commit is contained in:
1 parent
e24212f797
commit
bb645e9832
1 file changed
+10
-4
+10
-4
@@ -48,11 +48,17 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
- (BOOL)isUpdateInProgress
|
||||
{
|
||||
BOOL result = NO;
|
||||
NSConnection *connection = [NSConnection connectionWithRegisteredName:[NSString stringWithFormat:@"Sparkle %@", [[host bundle] bundleIdentifier]] host:nil];
|
||||
if (connection != nil)
|
||||
@try
|
||||
{
|
||||
NSConnection *connection = [NSConnection connectionWithRegisteredName:[NSString stringWithFormat:@"Sparkle %@", [[host bundle] bundleIdentifier]] host:nil];
|
||||
if (connection != nil)
|
||||
{
|
||||
NSDistantObject *proxyBundle = [connection rootProxy];
|
||||
result = proxyBundle != nil;
|
||||
}
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSDistantObject *proxyBundle = [connection rootProxy];
|
||||
result = proxyBundle != nil;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in new issue
Block a user