Skip to content

Commit

Permalink
Merge pull request #185 from tresni/FixCrash
Browse files Browse the repository at this point in the history
Catch exceptions when NSTask fails
  • Loading branch information
matryer committed Jan 22, 2016
2 parents 87ef02b + fc33e60 commit 13d8f35
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion App/BitBar/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ - (void) startTask:(NSMutableDictionary*)params {
[self performSelectorOnMainThread:@selector(performRefreshNow:) withObject:NULL waitUntilDone:false];
}
};
[(NSTask*)task launch];
@try {
[(NSTask*)task launch];
} @catch (NSException *e) {
NSLog(@"Error launching command for %@:\n\tCMD: %@\n\tARGS: %@\n%@", self.name, params[@"bash"], params[@"args"], e);
}
[(NSTask*)task waitUntilExit];
}

Expand Down

0 comments on commit 13d8f35

Please sign in to comment.