[haiku-commits] r40463 - haiku/trunk/src/apps/people

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 12 Feb 2011 18:42:23 +0100 (CET)

Author: stippi
Date: 2011-02-12 18:42:22 +0100 (Sat, 12 Feb 2011)
New Revision: 40463
Changeset: http://dev.haiku-os.org/changeset/40463

Modified:
   haiku/trunk/src/apps/people/PersonView.cpp
Log:
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)


Modified: haiku/trunk/src/apps/people/PersonView.cpp
===================================================================
--- haiku/trunk/src/apps/people/PersonView.cpp  2011-02-12 17:40:58 UTC (rev 
40462)
+++ haiku/trunk/src/apps/people/PersonView.cpp  2011-02-12 17:42:22 UTC (rev 
40463)
@@ -41,6 +41,7 @@
                const entry_ref *ref)
        :
        BGridView(),
+       fGroups(NULL),
        fControls(20, false),
        fCategoryAttribute(categoryAttribute)
 {
@@ -142,6 +143,9 @@
 void
 PersonView::BuildGroupMenu()
 {
+       if (fGroups == NULL)
+               return;
+
        BMenuItem* item;
        while ((item = fGroups->ItemAt(0)) != NULL) {
                fGroups->RemoveItem(item);


Other related posts:

  • » [haiku-commits] r40463 - haiku/trunk/src/apps/people - superstippi