View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0032446 | FPC | FCL | public | 2017-09-20 09:25 | 2017-09-20 16:51 |
Reporter | Petr-K | Assigned To | Michael Van Canneyt | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | independent | OS | OS Version | ||
Product Version | 3.1.1 | Product Build | Revision: 36503 | ||
Target Version | 3.2.0 | Fixed in Version | 3.1.1 | ||
Summary | 0032446: Bad exception handling in TFloatField.SetAsString | ||||
Description | try f := StrToFloat(AValue); SetAsFloat(f); <- exception here is hidden by "not valid float" except DatabaseErrorFmt(SNotAFloat, [AValue]); end; SetAsFloat should be outside of try except. Patch is included. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 37267 | ||||
FPCOldBugId | |||||
FPCTarget | |||||
Attached Files |
|
|
fields.patch (539 bytes)
Index: packages/fcl-db/src/base/fields.inc =================================================================== --- packages/fcl-db/src/base/fields.inc (revision 36503) +++ packages/fcl-db/src/base/fields.inc (working copy) @@ -2070,13 +2070,14 @@ begin If (AValue='') then Clear - else + else begin try f := StrToFloat(AValue); - SetAsFloat(f); except DatabaseErrorFmt(SNotAFloat, [AValue]); end; + SetAsFloat(f); + end; end; procedure TFloatField.SetVarValue(const AValue: Variant); |
|
I have fixed this slightly different. Thanks for reporting and for the patch. |
|
works fine |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-09-20 09:25 | Petr-K | New Issue | |
2017-09-20 09:25 | Petr-K | File Added: fields.patch | |
2017-09-20 16:00 | Michael Van Canneyt | Fixed in Revision | => 37267 |
2017-09-20 16:00 | Michael Van Canneyt | Note Added: 0102943 | |
2017-09-20 16:00 | Michael Van Canneyt | Status | new => resolved |
2017-09-20 16:00 | Michael Van Canneyt | Fixed in Version | => 3.1.1 |
2017-09-20 16:00 | Michael Van Canneyt | Resolution | open => fixed |
2017-09-20 16:00 | Michael Van Canneyt | Assigned To | => Michael Van Canneyt |
2017-09-20 16:00 | Michael Van Canneyt | Target Version | => 3.2.0 |
2017-09-20 16:51 | Petr-K | Note Added: 0102948 | |
2017-09-20 16:51 | Petr-K | Status | resolved => closed |