Browse Source

Quick.Console small fix

Unknown 6 years ago
parent
commit
4435be3c0d
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Quick.Console.pas

+ 5 - 1
Quick.Console.pas

@@ -1064,7 +1064,11 @@ InitCriticalSection(CSConsole);
   {$IFNDEF DELPHILINUX}
   InitializeCriticalSection(CSConsole);
   //init stdout if not a service
-  if GetStdHandle(STD_OUTPUT_HANDLE) <> 0 then InitConsole;
+  try
+    if GetStdHandle(STD_OUTPUT_HANDLE) <> 0 then InitConsole;
+  except
+    //avoid raise exception
+  end;
   {$ELSE}
   CSConsole := TRTLCriticalSection.Create;
   {$ENDIF}