From c827a83dff35323973ab9a76dce7b114c9161922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Tue, 25 Feb 2020 23:25:52 +0100 Subject: [PATCH] Attempted fix for the ArgumentException when calling ITaskService.GetRunningTasks on some systems. --- GUI/StartupManager.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/GUI/StartupManager.cs b/GUI/StartupManager.cs index f645f16..d5f8344 100644 --- a/GUI/StartupManager.cs +++ b/GUI/StartupManager.cs @@ -4,7 +4,7 @@ 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/. - Copyright (C) 2009-2010 Michael Möller + Copyright (C) 2009-2020 Michael Möller */ @@ -55,9 +55,11 @@ namespace OpenHardwareMonitor.GUI { } if (scheduler != null) { - try { - // check if the taskscheduler is running - IRunningTaskCollection collection = scheduler.GetRunningTasks(0); + try { + try { + // check if the taskscheduler is running + IRunningTaskCollection collection = scheduler.GetRunningTasks(0); + } catch (ArgumentException) { } ITaskFolder folder = scheduler.GetFolder("\\Open Hardware Monitor"); IRegisteredTask task = folder.GetTask("Startup");