Browse Source

Quick.Threads little fix

Unknown 6 years ago
parent
commit
463ee9f432
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Quick.Threads.pas

+ 2 - 1
Quick.Threads.pas

@@ -7,7 +7,7 @@
   Author      : Kike Pérez
   Author      : Kike Pérez
   Version     : 1.4
   Version     : 1.4
   Created     : 09/03/2018
   Created     : 09/03/2018
-  Modified    : 21/01/2019
+  Modified    : 24/01/2019
 
 
   This file is part of QuickLib: https://github.com/exilon/QuickLib
   This file is part of QuickLib: https://github.com/exilon/QuickLib
 
 
@@ -1223,6 +1223,7 @@ end;
 
 
 function TScheduledTasks.GetTask(const aTaskName: string): IScheduledTask;
 function TScheduledTasks.GetTask(const aTaskName: string): IScheduledTask;
 begin
 begin
+  if not Assigned(fScheduler) then raise Exception.Create('Scheduler must be started to get a task!');
   Result := fScheduler.Get(aTaskName);
   Result := fScheduler.Get(aTaskName);
 end;
 end;