Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiraSora committed Oct 22, 2024
1 parent ae590bb commit abe19f4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions OngekiFumenEditor/Kernel/ProgramUpdater/DefaultProgramUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public bool HasNewVersion
{
get
{
if (RemoteVersionInfo.Version is not Version remoteVersion)
if (RemoteVersionInfo?.Version is not Version remoteVersion)
return false;
var localVersion = Version.Parse(ThisAssembly.AssemblyFileVersion);

Expand All @@ -64,8 +64,11 @@ public VersionInfo RemoteVersionInfo
Set(ref remoteVersionInfo, value);
NotifyOfPropertyChange(nameof(HasNewVersion));

if (updatableButton is not null)
updatableButton.Visibility = HasNewVersion ? Visibility.Visible : Visibility.Collapsed;
App.Current.Dispatcher.Invoke(() =>
{
if (updatableButton is not null)
updatableButton.Visibility = HasNewVersion ? Visibility.Visible : Visibility.Collapsed;
});
}
}

Expand Down Expand Up @@ -172,7 +175,7 @@ public async Task CheckUpdatable()
}

if ((App.Current as App)?.IsGUIMode ?? false)
ModifyFrameworkMenuView();
App.Current.Dispatcher.Invoke(ModifyFrameworkMenuView);

try
{
Expand Down

0 comments on commit abe19f4

Please sign in to comment.