Browse Source

fcl-db: sqldb: Make ESQLDatabaseError.CreateFmt more safe if it is called with Args=[] (then do not try Format(Msg,Args))

git-svn-id: trunk@29169 -
lacak 10 years ago
parent
commit
c41bc63cd4
1 changed files with 5 additions and 1 deletions
  1. 5 1
      packages/fcl-db/src/sqldb/sqldb.pp

+ 5 - 1
packages/fcl-db/src/sqldb/sqldb.pp

@@ -757,7 +757,11 @@ begin
   else
   else
     Msg := Format(CompNameFmt, [Comp.Name,Fmt]);
     Msg := Format(CompNameFmt, [Comp.Name,Fmt]);
 
 
-  inherited CreateFmt(Msg, Args);
+  if Length(Args) = 0 then
+    inherited Create(Msg)
+  else
+    inherited CreateFmt(Msg, Args);
+
   ErrorCode := AErrorCode;
   ErrorCode := AErrorCode;
   SQLState  := ASQLState;
   SQLState  := ASQLState;
 end;
 end;