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
This commit is contained in:
Stephan Aßmus 2011-02-12 17:42:22 +00:00
parent 968ec77e1f
commit fd44ef4211
1 changed files with 4 additions and 0 deletions

View File

@ -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);