Log Message:
-----------
When logged in as non-superuser, calling properties on database crashes the 
application. Closer examination shows that there are several bugs in dlgProperty.cpp, 
all connected to securityPage object.
[Darko Prenosil]

Modified Files:
--------------
    pgadmin3/src/ui:
        dlgProperty.cpp (r1.90 -> r1.91)

Index: dlgProperty.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgProperty.cpp,v
retrieving revision 1.90
retrieving revision 1.91
diff -Lsrc/ui/dlgProperty.cpp -Lsrc/ui/dlgProperty.cpp -u -w -r1.90 -r1.91
--- src/ui/dlgProperty.cpp
+++ src/ui/dlgProperty.cpp
@@ -1143,7 +1143,8 @@
                 }
             }
         }
-    }
+    }else
+       securityPage = NULL;
 }
 
 
@@ -1155,6 +1156,7 @@
 
 int dlgSecurityProperty::Go(bool modal)
 {
+    if (securityPage)
     securityPage->SetConnection(connection);
     
     return dlgProperty::Go(modal);
@@ -1163,7 +1165,7 @@
 
 void dlgSecurityProperty::AddGroups(ctlComboBox *comboBox)
 {
-    if ((!securityPage || !securityPage->cbGroups) && !comboBox)
+    if (!((securityPage && securityPage->cbGroups) || comboBox))
         return;
 
     pgSet *set=connection->ExecuteSet(wxT("SELECT groname FROM pg_group ORDER BY 
groname"));
@@ -1239,7 +1241,10 @@
 
 wxString dlgSecurityProperty::GetGrant(const wxString &allPattern, const wxString 
&grantObject)
 {
+    if (securityPage)
     return securityPage->GetGrant(allPattern, grantObject, &currentAcl);
+    else
+       return wxString();
 }
 
 
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to