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