2
0
Эх сурвалжийг харах

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

git-svn-id: trunk@32566 -
lacak 9 жил өмнө
parent
commit
6f9d542d81

+ 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