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:
parent
968ec77e1f
commit
fd44ef4211
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue