Tracker: Tracker crashes in KeyDown() if there are no models associated with the PoseView.

Happens in special windows, such as OpenWith Window, that do have a PoseView not associated
with a model.  Fixes #8160.
This commit is contained in:
Philippe Saint-Pierre 2012-11-25 15:05:19 -05:00
parent 52cdfde04b
commit dbe3088153

View File

@ -6445,6 +6445,10 @@ BPoseView::KeyDown(const char* bytes, int32 count)
case B_DELETE:
{
if (TargetModel() == NULL) {
// Happens if called from within OpenWith window, for example
break;
}
// Make sure user can't trash something already in the trash.
if (TargetModel()->IsTrash()) {
// Delete without asking from the trash