Sfoglia il codice sorgente

* Fix bug #32446: exception was being eaten by wrong use of try...except

git-svn-id: trunk@37267 -
michael 7 anni fa
parent
commit
d99b19734e
1 ha cambiato i file con 3 aggiunte e 4 eliminazioni
  1. 3 4
      packages/fcl-db/src/base/fields.inc

+ 3 - 4
packages/fcl-db/src/base/fields.inc

@@ -2071,11 +2071,10 @@ begin
   If (AValue='') then
     Clear
   else  
-    try
-      f := StrToFloat(AValue);
-      SetAsFloat(f);
-    except
+    begin
+    If not TryStrToFloat(AValue,F) then
       DatabaseErrorFmt(SNotAFloat, [AValue]);
+    SetAsFloat(f);
     end;
 end;