diff --git a/Lagrange.OneBot/Core/Network/Service/ForwardWSService.cs b/Lagrange.OneBot/Core/Network/Service/ForwardWSService.cs index f7e145c14..0503c1329 100644 --- a/Lagrange.OneBot/Core/Network/Service/ForwardWSService.cs +++ b/Lagrange.OneBot/Core/Network/Service/ForwardWSService.cs @@ -126,10 +126,17 @@ public async ValueTask SendJsonAsync(T json, string? identifier = null, Cance private void OnHeartbeat(object? _, string identifier) { - var status = new OneBotStatus(true, true); - var heartBeat = new OneBotHeartBeat(_context.BotUin, (int)_options.HeartBeatInterval, status); + try + { + var status = new OneBotStatus(true, true); + var heartBeat = new OneBotHeartBeat(_context.BotUin, (int)_options.HeartBeatInterval, status); - SendJsonAsync(heartBeat, identifier).GetAwaiter().GetResult(); + SendJsonAsync(heartBeat, identifier).GetAwaiter().GetResult(); + } + catch + { + // ignored + } } private static bool IsPortInUse(uint port) =>