mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-22 18:07:09 +00:00
Attempted fix for the ArgumentException when calling ITaskService.GetRunningTasks on some systems.
This commit is contained in:
parent
56ee2f5c0d
commit
c827a83dff
@ -4,7 +4,7 @@
|
|||||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
Copyright (C) 2009-2010 Michael Möller <mmoeller@openhardwaremonitor.org>
|
Copyright (C) 2009-2020 Michael Möller <mmoeller@openhardwaremonitor.org>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -55,9 +55,11 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (scheduler != null) {
|
if (scheduler != null) {
|
||||||
|
try {
|
||||||
try {
|
try {
|
||||||
// check if the taskscheduler is running
|
// check if the taskscheduler is running
|
||||||
IRunningTaskCollection collection = scheduler.GetRunningTasks(0);
|
IRunningTaskCollection collection = scheduler.GetRunningTasks(0);
|
||||||
|
} catch (ArgumentException) { }
|
||||||
|
|
||||||
ITaskFolder folder = scheduler.GetFolder("\\Open Hardware Monitor");
|
ITaskFolder folder = scheduler.GetFolder("\\Open Hardware Monitor");
|
||||||
IRegisteredTask task = folder.GetTask("Startup");
|
IRegisteredTask task = folder.GetTask("Startup");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user