fix potential crash with invalid OTP strings
This commit is contained in:
@@ -40,14 +40,25 @@ namespace keepass2android
|
||||
{
|
||||
if (entry == null)
|
||||
return null;
|
||||
|
||||
try
|
||||
{
|
||||
foreach (ITotpPluginAdapter adapter in _pluginAdapters)
|
||||
{
|
||||
TotpData totpData = adapter.GetTotpData(App.Kp2a.LastOpenedEntry.OutputStrings.ToDictionary(pair => StrUtil.SafeXmlString(pair.Key), pair => pair.Value.ReadString()), Application.Context, false);
|
||||
TotpData totpData = adapter.GetTotpData(
|
||||
App.Kp2a.LastOpenedEntry.OutputStrings.ToDictionary(pair => StrUtil.SafeXmlString(pair.Key),
|
||||
pair => pair.Value.ReadString()), Application.Context, false);
|
||||
if (totpData.IsTotpEntry)
|
||||
{
|
||||
return adapter;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Kp2aLog.LogUnexpectedError(e);
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user