mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
add try/catch around service check
This commit is contained in:
parent
0fd4b0ffca
commit
e5c2e4b28d
@ -195,6 +195,8 @@ namespace MediaBrowser.ServerApplication
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsAlreadyRunningAsService(string applicationPath)
|
private static bool IsAlreadyRunningAsService(string applicationPath)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var serviceName = BackgroundService.GetExistingServiceName();
|
var serviceName = BackgroundService.GetExistingServiceName();
|
||||||
|
|
||||||
@ -220,6 +222,11 @@ namespace MediaBrowser.ServerApplication
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (COMException)
|
||||||
|
{
|
||||||
|
// Catch errors thrown due to WMI not being initialized
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user