Update BotBase.cs

- prevent BotBase from crashing on  loading serialized sessions
This commit is contained in:
FlorianDahn 2020-04-05 23:31:37 +07:00
parent 0cdb8c3a1a
commit 8b66842d34

View File

@ -539,10 +539,18 @@ namespace TelegramBotBase
this.Sessions.SessionList.Add(s.DeviceId, device); this.Sessions.SessionList.Add(s.DeviceId, device);
try
{
await form.OnInit(new InitEventArgs()); await form.OnInit(new InitEventArgs());
await form.OnOpened(new EventArgs()); await form.OnOpened(new EventArgs());
} }
catch
{
//Skip on exception
this.Sessions.SessionList.Remove(s.DeviceId);
}
}
} }