Explorar o código

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

git-svn-id: trunk@37267 -
michael %!s(int64=7) %!d(string=hai) anos
pai
achega
d99b19734e
Modificáronse 1 ficheiros con 3 adicións e 4 borrados
  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
   If (AValue='') then
     Clear
     Clear
   else  
   else  
-    try
-      f := StrToFloat(AValue);
-      SetAsFloat(f);
-    except
+    begin
+    If not TryStrToFloat(AValue,F) then
       DatabaseErrorFmt(SNotAFloat, [AValue]);
       DatabaseErrorFmt(SNotAFloat, [AValue]);
+    SetAsFloat(f);
     end;
     end;
 end;
 end;