LCL: TSpeedButton, TBitBtn: fix AV. Issue #33645

git-svn-id: trunk@57704 -
This commit is contained in:
ondrej 2018-04-25 08:03:03 +00:00
parent 9e333da657
commit 2ef8957cd8
2 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ procedure TCustomBitBtn.Notification(AComponent: TComponent;
Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
if (Operation = opRemove) and (AComponent = FButtonGlyph.ExternalImages) then
if (Operation = opRemove) and (FButtonGlyph <> nil) and (AComponent = FButtonGlyph.ExternalImages) then
Images := nil;
end;

View File

@ -860,7 +860,7 @@ procedure TCustomSpeedButton.Notification(AComponent: TComponent;
Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
if (Operation = opRemove) and (AComponent = FGlyph.ExternalImages) then
if (Operation = opRemove) and (FGlyph<>nil) and (AComponent = FGlyph.ExternalImages) then
Images := nil;
end;