From fd44ef42117c1f14167ee3a376516d34628835c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 12 Feb 2011 17:42:22 +0000 Subject: [PATCH] Initialize fGroups, since that is used in BuildGroupMenu() called by the window. If the user removed the groups attribute from the Person MIME type, People would crash when trying to open any menu. (untested) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40463 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/people/PersonView.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/apps/people/PersonView.cpp b/src/apps/people/PersonView.cpp index f1e308c368..6552f321a1 100644 --- a/src/apps/people/PersonView.cpp +++ b/src/apps/people/PersonView.cpp @@ -41,6 +41,7 @@ PersonView::PersonView(const char* name, const char* categoryAttribute, const entry_ref *ref) : BGridView(), + fGroups(NULL), fControls(20, false), fCategoryAttribute(categoryAttribute) { @@ -142,6 +143,9 @@ PersonView::MessageReceived(BMessage* msg) void PersonView::BuildGroupMenu() { + if (fGroups == NULL) + return; + BMenuItem* item; while ((item = fGroups->ItemAt(0)) != NULL) { fGroups->RemoveItem(item);