Skip to content

Commit a5c4be5

Browse files
committed
fix: 修改报错实现
1 parent 8d74a1b commit a5c4be5

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

TuneLab/App.axaml.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,7 @@ public override void OnFrameworkInitializationCompleted()
7777
}
7878

7979
// 获取主线程SynchronizationContext
80-
var context = SynchronizationContext.Current;
81-
if (context == null)
82-
{
83-
Log.Error("SynchronizationContext.Current is null");
84-
return;
85-
}
80+
var context = SynchronizationContext.Current ?? throw new InvalidOperationException("SynchronizationContext.Current is null");
8681

8782
// 监听其他实例的启动参数
8883
Task.Run(() =>

0 commit comments

Comments
 (0)