mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
MasterTabBarController: Add sanity checks when add or remove a session. Fix runtime issue with Xcode 12.5 and NSArray mismatch type with Swift (see https://forums.swift.org/t/objective-c-interoperability-type-mismatch/12464 for more information).
This commit is contained in:
@@ -356,6 +356,12 @@
|
||||
|
||||
- (void)addMatrixSession:(MXSession *)mxSession
|
||||
{
|
||||
if ([mxSessionArray containsObject:mxSession])
|
||||
{
|
||||
MXLogDebug(@"MasterTabBarController already has %@ in mxSessionArray", mxSession)
|
||||
return;
|
||||
}
|
||||
|
||||
// Check whether the controller's view is loaded into memory.
|
||||
if (self.homeViewController)
|
||||
{
|
||||
@@ -394,6 +400,12 @@
|
||||
|
||||
- (void)removeMatrixSession:(MXSession *)mxSession
|
||||
{
|
||||
if (![mxSessionArray containsObject:mxSession])
|
||||
{
|
||||
MXLogDebug(@"MasterTabBarController does not contain %@ in mxSessionArray", mxSession)
|
||||
return;
|
||||
}
|
||||
|
||||
[recentsDataSource removeMatrixSession:mxSession];
|
||||
|
||||
// Check whether there are others sessions
|
||||
|
||||
Reference in New Issue
Block a user