MaskEdit: check if control can be focussed before focussing when validation fails in DoExit. Issue #0030482. Patch by Lutz Mändle.

git-svn-id: trunk@52837 -
This commit is contained in:
bart 2016-08-19 20:20:43 +00:00
parent 5230d13340
commit 5bf9ffa801

View File

@ -1778,7 +1778,9 @@ begin
FValidationFailed := False; FValidationFailed := False;
end ; end ;
finally finally
if FValidationFailed then //also check if control can be focussed, otherwise risk an exception while
//handling an exception, issue #0030482
if FValidationFailed and CanSetFocus then
begin begin
//debugln('TCustomMaskedit.DoExit: Validation failed'); //debugln('TCustomMaskedit.DoExit: Validation failed');
SetFocus; SetFocus;