From d219b1fcfcf9537bd61de746f1918bae678f5fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 26 Jul 2009 16:46:05 +0000 Subject: [PATCH] * Let AddMimeMenu() check if the MIME type is valid, otherwise BMimeType::Type() could return NULL. This fixes the crashing part of #4037. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31777 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/ContainerWindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp index 1baa4267d6..06af70c84a 100644 --- a/src/kits/tracker/ContainerWindow.cpp +++ b/src/kits/tracker/ContainerWindow.cpp @@ -1107,7 +1107,7 @@ BContainerWindow::FrameResized(float, float) if (scroll != B_ORIGIN) PoseView()->ScrollBy(scroll.x, scroll.y); - + PoseView()->UpdateScrollRange(); PoseView()->ResetPosePlacementHint(); } @@ -3172,6 +3172,9 @@ BMenu* BContainerWindow::AddMimeMenu(const BMimeType& mimeType, bool isSuperType, BMenu* menu, int32 start) { + if (!mimeType.IsValid()) + return NULL; + // Check if we already have an entry for this MIME type in the menu. for (int32 i = start; BMenuItem* item = menu->ItemAt(i); i++) { BMessage* message = item->Message();