Update BotBase.cs
- prevent BotBase from crashing on loading serialized sessions
This commit is contained in:
parent
0cdb8c3a1a
commit
8b66842d34
@ -539,9 +539,17 @@ namespace TelegramBotBase
|
||||
|
||||
this.Sessions.SessionList.Add(s.DeviceId, device);
|
||||
|
||||
await form.OnInit(new InitEventArgs());
|
||||
try
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user