Fix: potential crashes in profile mgr, wrong debug_logging category
This commit is contained in:
1 parent
b9d6e14015
commit
72edd15dfb
3 files changed
+12
-2
No files matched your search
@@ -163,6 +163,10 @@
|
||||
[self.versionPickerView reloadAllComponents];
|
||||
// Reload selected profile info
|
||||
self.profileSelectedAt = [PLProfiles.current.profiles.allKeys indexOfObject:PLProfiles.current.selectedProfileName];
|
||||
if (self.profileSelectedAt == -1) {
|
||||
// This instance has no profiles?
|
||||
return;
|
||||
}
|
||||
[self.versionPickerView selectRow:self.profileSelectedAt inComponent:0 animated:NO];
|
||||
[self pickerView:self.versionPickerView didSelectRow:self.profileSelectedAt inComponent:0];
|
||||
}
|
||||
|
||||
@@ -203,7 +203,13 @@
|
||||
confirmAlert.popoverPresentationController.sourceRect = cell.bounds;
|
||||
UIAlertAction *ok = [UIAlertAction actionWithTitle:localize(@"OK", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
|
||||
[PLProfiles.current.profiles removeObjectForKey:cell.textLabel.text];
|
||||
[PLProfiles.current save];
|
||||
if ([PLProfiles.current.selectedProfileName isEqualToString:cell.textLabel.text]) {
|
||||
// The one being deleted is the selected one, switch to the random one now
|
||||
PLProfiles.current.selectedProfileName = PLProfiles.current.profiles.allKeys[0];
|
||||
[self.navigationController performSelector:@selector(reloadProfileList)];
|
||||
} else {
|
||||
[PLProfiles.current save];
|
||||
}
|
||||
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
}];
|
||||
UIAlertAction *cancel = [UIAlertAction actionWithTitle:localize(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
|
||||
|
||||
@@ -71,7 +71,7 @@ static AFURLSessionManager* manager;
|
||||
}
|
||||
|
||||
BOOL check = [sha isEqualToString:localSHA];
|
||||
if (!check || (getPrefBool(@"debug.debug_logging") && logSuccess)) {
|
||||
if (!check || (getPrefBool(@"general.debug_logging") && logSuccess)) {
|
||||
NSLog(@"[MCDL] SHA1 %@ for %@%@",
|
||||
(check ? @"passed" : @"failed"),
|
||||
(altName ? altName : path.lastPathComponent),
|
||||
|
||||
Reference in new issue
Block a user