Browse Source

fcl-db: sqldb: fixes AV when SQL is empty, Cursor is not allocated yet. Bug #29124

git-svn-id: trunk@32566 -
lacak 9 năm trước cách đây
mục cha
commit
6f9d542d81
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      packages/fcl-db/src/sqldb/sqldb.pp

+ 4 - 4
packages/fcl-db/src/sqldb/sqldb.pp

@@ -1228,11 +1228,11 @@ begin
   if not ATransaction.Active then
     ATransaction.MaybeStartTransaction;
 
-  try
-    SQL := TrimRight(SQL);
-    if SQL = '' then
-      DatabaseError(SErrNoStatement);
+  SQL := TrimRight(SQL);
+  if SQL = '' then
+    DatabaseError(SErrNoStatement);
 
+  try
     Cursor := AllocateCursorHandle;
     Cursor.FStatementType := stUnknown;
     If LogEvent(detPrepare) then