mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-20 15:30:28 +01:00
Fix StartupManager exception
This commit is contained in:
parent
7bf7d8db3d
commit
ec0a84283b
|
|
@ -42,7 +42,7 @@ namespace ExternalHelpers
|
|||
return;
|
||||
}
|
||||
|
||||
if (IsAdministrator() && TaskService.Instance.Connected)
|
||||
if (IsAdministrator() && IsTaskServiceConnect)
|
||||
{
|
||||
IsAvailable = true;
|
||||
|
||||
|
|
@ -82,6 +82,16 @@ namespace ExternalHelpers
|
|||
|
||||
public bool IsAvailable { get; }
|
||||
|
||||
public bool IsTaskServiceConnect
|
||||
{
|
||||
get
|
||||
{
|
||||
// The likest inner exception is: System.UnauthorizedAccessException
|
||||
try { return TaskService.Instance.Connected; }
|
||||
catch (TypeInitializationException) { return false; }
|
||||
}
|
||||
}
|
||||
|
||||
public bool Startup
|
||||
{
|
||||
get { return _startup; }
|
||||
|
|
@ -91,7 +101,7 @@ namespace ExternalHelpers
|
|||
{
|
||||
if (IsAvailable)
|
||||
{
|
||||
if (TaskService.Instance.Connected)
|
||||
if (IsTaskServiceConnect)
|
||||
{
|
||||
if (value)
|
||||
CreateTask();
|
||||
|
|
|
|||
Loading…
Reference in a new issue