diff --git a/src/AcDream.App/Net/LiveSessionController.cs b/src/AcDream.App/Net/LiveSessionController.cs index e6ccb422..82bab1ad 100644 --- a/src/AcDream.App/Net/LiveSessionController.cs +++ b/src/AcDream.App/Net/LiveSessionController.cs @@ -342,6 +342,8 @@ internal sealed class LiveSessionController catch (Exception tickError) { Exception error = StopAfterFailure(tickError); + if (ReferenceEquals(error, tickError)) + throw; throw error; } }); diff --git a/tests/AcDream.App.Tests/Net/LiveSessionControllerTests.cs b/tests/AcDream.App.Tests/Net/LiveSessionControllerTests.cs index 4b4539fc..91883825 100644 --- a/tests/AcDream.App.Tests/Net/LiveSessionControllerTests.cs +++ b/tests/AcDream.App.Tests/Net/LiveSessionControllerTests.cs @@ -805,11 +805,16 @@ public sealed class LiveSessionControllerTests controller.Start(LiveOptions(), host); WorldSession session = operations.Sessions[0]; - Assert.Throws(controller.Tick); + InvalidOperationException error = + Assert.Throws(controller.Tick); Assert.False(controller.IsInWorld); Assert.Null(controller.CurrentSession); Assert.Equal(1, operations.DisposeCounts[session]); + Assert.Contains( + $"{nameof(TestOperations)}.{nameof(TestOperations.Tick)}", + error.StackTrace, + StringComparison.Ordinal); } [Fact]