diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-23 17:13:29 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-07 02:41:12 -0800 |
commit | 62cab237b7407687c04d4dc18e404aec4b0a091b (patch) | |
tree | 25fb7991ffbcbdcdbe762d30f4efc248f1c87299 | |
parent | bf1d5e6995608d94751fcbdc76514283cfb82e18 (diff) |
Make cydia.getPackageById() return null instead of undefined.
-rw-r--r-- | MobileCydia.mm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index b73ed67..83215cf 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4194,9 +4194,11 @@ static NSString *Warning_; } } - (Package *) getPackageById:(NSString *)id { - Package *package([[Database sharedInstance] packageWithName:id]); - [package parse]; - return package; + if (Package *package = [[Database sharedInstance] packageWithName:id]) { + [package parse]; + return package; + } else + return (Package *) [NSNull null]; } - (NSArray *) statfs:(NSString *)path { |