Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes an array index error that was being caught and thus not crashin…

…g the app.

git-svn-id: http://ios.svn.wordpress.org/trunk@3621 7d847f7c-ffe1-4a24-85be-b788d016d96a
  • Loading branch information...
commit d63234ab8ace8584a875a136a17b1f78215c1dbe 1 parent 7ba7858
aerych authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 Classes/SidebarViewController.m
View
7 Classes/SidebarViewController.m
@@ -381,6 +381,7 @@ - (void)selectFirstAvailableBlog {
}
- (void)selectBlogWithSection:(NSUInteger)index {
+NSLog(@"%@", self.sectionInfoArray);
SectionInfo *sectionInfo = [self.sectionInfoArray objectAtIndex:index - 1];
if (!sectionInfo.open) {
[sectionInfo.headerView toggleOpenWithUserAction:YES];
@@ -1071,7 +1072,11 @@ - (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
if (indexPath) {
if (indexPath.section != wantedSection || changingContentForSelectedSection) {
if (wantedSection > 0) {
- [self selectBlogWithSection:wantedSection];
+ NSUInteger sec = wantedSection;
+ if (wantedSection > indexPath.section) {
+ sec = indexPath.section; // Prevents an out of index error that was being error trapped, thus hiding a crash.
+ }
+ [self selectBlogWithSection:sec];
} else {
[self selectFirstAvailableItem];
}
Please sign in to comment.
Something went wrong with that request. Please try again.