From 6c775d6e0c44b0cc4614f7358db8ad077bd996e2 Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 21 May 2023 16:22:40 +0200 Subject: [PATCH] Moved check into if statement --- Tranga/TaskManager.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tranga/TaskManager.cs b/Tranga/TaskManager.cs index 59efb5e..6b23722 100644 --- a/Tranga/TaskManager.cs +++ b/Tranga/TaskManager.cs @@ -125,8 +125,6 @@ public class TaskManager string language = "") { logger?.WriteLine(this.GetType().ToString(), $"Adding new Task {task} {connectorName} {publication?.sortName}"); - if (task != TrangaTask.Task.UpdateKomgaLibrary && connectorName is null) - throw new ArgumentException($"connectorName can not be null for task {task}"); TrangaTask newTask; if (task == TrangaTask.Task.UpdateKomgaLibrary) @@ -142,6 +140,9 @@ public class TaskManager } else { + if(connectorName is null) + throw new ArgumentException($"connectorName can not be null for task {task}"); + //Get appropriate Connector from available Connectors for TrangaTask Connector? connector = _connectors.FirstOrDefault(c => c.name == connectorName); if (connector is null)