Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble-iphoneos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Krautz <mikkel@krautz.dk>2012-01-16 05:35:41 +0400
committerMikkel Krautz <mikkel@krautz.dk>2012-01-16 05:35:41 +0400
commitd689998246c0a0f2bf5c122a0743eb37707b9cba (patch)
treeb441b408657791c4b5063ea3583006d4ad7a04cd /Source/Classes/MUServerViewController.m
parent5276d280a648a7aff1ffb992eb629207a3aacc5a (diff)
Don't attempt to delete a non-existing row when users connect to the server in MUServerViewController.
Diffstat (limited to 'Source/Classes/MUServerViewController.m')
-rw-r--r--Source/Classes/MUServerViewController.m9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/Classes/MUServerViewController.m b/Source/Classes/MUServerViewController.m
index 956229c..77e2565 100644
--- a/Source/Classes/MUServerViewController.m
+++ b/Source/Classes/MUServerViewController.m
@@ -301,8 +301,13 @@
[self reloadChannel:chan];
[self reloadChannel:prevChan];
}
- NSInteger prevIdx = [self indexForUser:user];
- [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:prevIdx inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
+
+ // Check if the user is joining a channel for the first time.
+ if (prevChan != nil) {
+ NSInteger prevIdx = [self indexForUser:user];
+ [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:prevIdx inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
+ }
+
[self rebuildModelArrayFromChannel:[model rootChannel]];
NSInteger newIdx = [self indexForUser:user];
[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:newIdx inSection:0]] withRowAnimation:UITableViewRowAnimationNone];