Skip to content

Commit 2361687

Browse files
committed
修复:处理更新日志为空的情况,提供默认提示文本
1 parent a5c7e9a commit 2361687

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Dialogs/ViewModels/UpdateViewModel.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ public UpdateViewModel(UpdateService updateService, UpdateInfo? updateInfo = nul
4343
if (_updateInfo != null)
4444
{
4545
Statistics.Version = _updateInfo.TargetFullRelease.Version.ToString();
46-
ReleaseNotes = _updateInfo.TargetFullRelease.NotesMarkdown;
46+
ReleaseNotes = !string.IsNullOrWhiteSpace(_updateInfo.TargetFullRelease.NotesMarkdown)
47+
? _updateInfo.TargetFullRelease.NotesMarkdown
48+
: "暂无更新日志";
4749
}
4850
else
4951
{
@@ -61,7 +63,9 @@ private async Task CheckUpdatesAsync()
6163
if (_updateInfo != null)
6264
{
6365
Statistics.Version = _updateInfo.TargetFullRelease.Version.ToString();
64-
ReleaseNotes = _updateInfo.TargetFullRelease.NotesMarkdown;
66+
ReleaseNotes = !string.IsNullOrWhiteSpace(_updateInfo.TargetFullRelease.NotesMarkdown)
67+
? _updateInfo.TargetFullRelease.NotesMarkdown
68+
: "暂无更新日志";
6569
}
6670
else
6771
{

0 commit comments

Comments
 (0)