diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index e129ad00a6..d0c7dd6a16 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -292,7 +292,7 @@ var OldChange: TNotifyEvent; OldCurrent: Integer; begin - if not FIcon.Empty then + if Assigned(FIcon) and not FIcon.Empty then begin if FBigIconHandle = 0 then begin @@ -319,7 +319,7 @@ var OldChange: TNotifyEvent; OldCurrent: Integer; begin - if not FIcon.Empty then + if Assigned(FIcon) and not FIcon.Empty then begin if FSmallIconHandle = 0 then begin diff --git a/lcl/include/scrollingwincontrol.inc b/lcl/include/scrollingwincontrol.inc index 31ce4f968d..4196aa5210 100644 --- a/lcl/include/scrollingwincontrol.inc +++ b/lcl/include/scrollingwincontrol.inc @@ -61,9 +61,9 @@ begin {if (FHorzScrollBar.Range>Result.Right) or (FVertScrollBar.Range>Result.Bottom) then DebugLn(['TScrollingWinControl.GetLogicalClientRect Client=',ClientWidth,'x',ClientHeight,' Ranges=',FHorzScrollBar.Range,'x',FVertScrollBar.Range]);} - if (FHorzScrollBar.Range > Result.Right) then + if Assigned(FHorzScrollBar) and (FHorzScrollBar.Range > Result.Right) then Result.Right := FHorzScrollBar.Range; - if (FVertScrollBar.Range > Result.Bottom) then + if Assigned(FVertScrollBar) and (FVertScrollBar.Range > Result.Bottom) then Result.Bottom := FVertScrollBar.Range; end;