element-ios
element-ios copied to clipboard
Application crashing because NSException not handled
In class MatrixSDK/Core/MXKeyProvider, the method - (nonnull MXKeyData *)keyDataForDataOfType:(NSString *)dataType raise Excpetion that doesn't seem to be always catched:
- (nonnull MXKeyData *)keyDataForDataOfType:(NSString *)dataType
isMandatory:(BOOL)isMandatory
expectedKeyType:(MXKeyType)keyType
{
MXKeyData *keyData = [self.delegate keyDataForDataOfType:dataType];
if (!keyData && isMandatory)
{
[NSException raise:@"MandatoryKey" format:@"No key value for mandatory Key (data type : %@)", dataType];
}
if (keyData && keyData.type != keyType)
{
[NSException raise:@"KeyType" format:@"Wrong key type (%lu expected %lu) for data of type : %@", keyData.type, keyType, dataType];
}
return keyData;
}
I think it causes crash when exiting application from background state.
Operating system version
iOS 16.3.1
Application version
Element Rebase 1.10.4
Homeserver
Tchap HomeServer
Will you send logs?
No
In my case exception generated when self.delegate is nil. Any idea?
@NicolasBuquet you can set delegate. I set It according to element . now it's working fine.