if FResPopupBrowser <> nil then begin
if not(Sender is TResPopupBrowser) then begin
- if (FResPopupBrowser.Visible) then begin
+ if ((doc <> nil) and (FResPopupBrowser.Visible)) then begin
if ResPopupClearTimer.Interval > 0 then begin
ResPopupClearTimer.Enabled := True;
ResPopupClearTimer.Tag := 0;