Update BotBase.cs
- prevent BotBase from crashing on loading serialized sessions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user