From 01c1f34248a0dae048c5f2412606ff5b4c329662 Mon Sep 17 00:00:00 2001 From: Ryan Burke Date: Mon, 10 Nov 2014 11:29:48 +0000 Subject: [PATCH] Added null check for package, shows error if not installed by Cydia. --- CyDelete8.xm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CyDelete8.xm b/CyDelete8.xm index 3773ce7..5e027f8 100644 --- a/CyDelete8.xm +++ b/CyDelete8.xm @@ -250,9 +250,20 @@ static void removeBundleFromMIList(NSString *bundle) { // We still don't have an entry (or a NSNull). We should probably bail out. if(!package) return; - - [uninstallQueue addOperation:[[CDUninstallDpkgOperation alloc] initWithPackage:package]]; + if(package == [NSNull null]) { + NSString *nonCydiaText = [NSString stringWithFormat:CDLocalizedString(@"PACKAGE_NOT_CYDIA_BODY"), package]; + UIAlertView *nonCydiaAlert = [[UIAlertView alloc] initWithTitle:CDLocalizedString(@"PACKAGE_NOT_CYDIA_TITLE") + message:nonCydiaText + delegate:nil + cancelButtonTitle:@"Okay" + otherButtonTitles:nil]; + [nonCydiaAlert show]; + return; + } + else { + [uninstallQueue addOperation:[[CDUninstallDpkgOperation alloc] initWithPackage:package]]; + } } %end