Skip to content

Commit

Permalink
Fix #10902 Terminal crashes setting window size.
Browse files Browse the repository at this point in the history
Terminal crashes because fView is not connected to App Server when
this is called so calling fView->GetMouse() is not allowed. We could
perhaps check to make sure that fView is connected to App Server by
checking that fView->Window() != NULL, but, a better way to handle this
is to grab the already set fLastClickPoint variable from fView
which eliminates the need to grab the current mouse position again.
Worst case scenario is that fLastClickPoint hasn't been set in which
case Terminal won't find anything to highlight or unhighlight.

Also check to make sure that fView != NULL here for good measure.

Fixes #10902
  • Loading branch information
jscipione committed Jun 5, 2014
1 parent b84955c commit 4c8d238
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/apps/terminal/TermViewStates.cpp
Expand Up @@ -966,10 +966,10 @@ TermView::HyperLinkState::_EntryExists(const BString& path,
void
TermView::HyperLinkState::_UpdateHighlight()
{
BPoint where;
uint32 buttons;
fView->GetMouse(&where, &buttons, false);
_UpdateHighlight(where, fView->fModifiers);
if (fView == NULL)
return;

_UpdateHighlight(fView->fLastClickPoint, fView->fModifiers);
}


Expand Down

0 comments on commit 4c8d238

Please sign in to comment.