From e85fa8f7871e5e97f81867c634777bd8e1a75d9a Mon Sep 17 00:00:00 2001 From: John Scipione Date: Thu, 24 Jul 2014 22:30:01 -0400 Subject: [PATCH] Tracker: Unchecked dynamic_cast, CID 1210856 --- src/kits/tracker/FindPanel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/kits/tracker/FindPanel.cpp b/src/kits/tracker/FindPanel.cpp index 9338d879a1..df823d80e8 100644 --- a/src/kits/tracker/FindPanel.cpp +++ b/src/kits/tracker/FindPanel.cpp @@ -2638,8 +2638,11 @@ FindPanel::AddAttributeControls(int32 gridRow) // target everything menu->SetTargetForItems(this); - for (int32 index = menu->CountItems() - 1; index >= 0; index--) - menu->SubmenuAt(index)->SetTargetForItems(this); + for (int32 index = menu->CountItems() - 1; index >= 0; index--) { + BMenu* submenuAtIndex = menu->SubmenuAt(index); + if (submenuAtIndex != NULL) + submenuAtIndex->SetTargetForItems(this); + } // populate mime popup AddMimeTypeAttrs(menu);