* 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
This commit is contained in:
parent
64ccb6b58a
commit
d219b1fcfc
@ -1107,7 +1107,7 @@ BContainerWindow::FrameResized(float, float)
|
|||||||
|
|
||||||
if (scroll != B_ORIGIN)
|
if (scroll != B_ORIGIN)
|
||||||
PoseView()->ScrollBy(scroll.x, scroll.y);
|
PoseView()->ScrollBy(scroll.x, scroll.y);
|
||||||
|
|
||||||
PoseView()->UpdateScrollRange();
|
PoseView()->UpdateScrollRange();
|
||||||
PoseView()->ResetPosePlacementHint();
|
PoseView()->ResetPosePlacementHint();
|
||||||
}
|
}
|
||||||
@ -3172,6 +3172,9 @@ BMenu*
|
|||||||
BContainerWindow::AddMimeMenu(const BMimeType& mimeType, bool isSuperType,
|
BContainerWindow::AddMimeMenu(const BMimeType& mimeType, bool isSuperType,
|
||||||
BMenu* menu, int32 start)
|
BMenu* menu, int32 start)
|
||||||
{
|
{
|
||||||
|
if (!mimeType.IsValid())
|
||||||
|
return NULL;
|
||||||
|
|
||||||
// Check if we already have an entry for this MIME type in the menu.
|
// Check if we already have an entry for this MIME type in the menu.
|
||||||
for (int32 i = start; BMenuItem* item = menu->ItemAt(i); i++) {
|
for (int32 i = start; BMenuItem* item = menu->ItemAt(i); i++) {
|
||||||
BMessage* message = item->Message();
|
BMessage* message = item->Message();
|
||||||
|
Loading…
Reference in New Issue
Block a user