From dbe3088153f100f652735b495d358f716cb2f8c1 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Sun, 25 Nov 2012 15:05:19 -0500 Subject: [PATCH] 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. --- src/kits/tracker/PoseView.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp index 390e12fa0d0..8e9c53f5eda 100644 --- a/src/kits/tracker/PoseView.cpp +++ b/src/kits/tracker/PoseView.cpp @@ -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