Skip to content

Commit

Permalink
fix(plugins/qqchannelplugin/controllers/homecontroller.cs): objectDis…
Browse files Browse the repository at this point in the history
…posed: IServiceProvider

System.ObjectDisposedException: Cannot access a disposed object. Object name: 'IServiceProvider'.
  • Loading branch information
yiyungent committed Aug 21, 2023
1 parent 8a1d756 commit 8806e9a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/QQChannelPlugin/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public async Task<ActionResult> Login()
SettingsModel settingsModel = PluginCore.PluginSettingsModelFactory.Create<SettingsModel>(nameof(QQChannelPlugin));
// 确保以前的都取消
#region 确保以前的都取消
if (QQChannelBotStore.Bots != null && QQChannelBotStore.Bots.Count >= 1) {
if (QQChannelBotStore.Bots != null && QQChannelBotStore.Bots.Count >= 1)
{
foreach (var item in QQChannelBotStore.Bots)
{
try
Expand Down Expand Up @@ -104,12 +105,12 @@ public async Task<ActionResult> Login()
QQChannelBotStore.Bots.Clear();
}
#endregion

foreach (var botConfig in settingsModel.Bots)
{
try
{
ChannelBotItem(botConfig, settingsModel);
await ChannelBotItem(botConfig, settingsModel);
}
catch (Exception ex)
{
Expand All @@ -123,7 +124,7 @@ public async Task<ActionResult> Login()
}

[NonAction]
public async void ChannelBotItem(SettingsModel.BotDevItemModel botConfig, SettingsModel settings)
public async Task ChannelBotItem(SettingsModel.BotDevItemModel botConfig, SettingsModel settings)
{
// https://www.yuque.com/chianne1025/mybot/otkzzg

Expand Down

0 comments on commit 8806e9a

Please sign in to comment.