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 năm trước cách đây
mục cha
commit
c41bc63cd4
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  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
     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;
   SQLState  := ASQLState;
 end;