SVN Commit by dpage: r4888 - trunk/pgadmin3/src - Mailing list pgadmin-hackers

From svn@pgadmin.org
Subject SVN Commit by dpage: r4888 - trunk/pgadmin3/src
Date
Msg-id 200601110923.k0B9NcJa026798@developer.pgadmin.org
Whole thread Raw
List pgadmin-hackers
Author: dpage
Date: 2006-01-11 09:23:37 +0000 (Wed, 11 Jan 2006)
New Revision: 4888

Modified:
   trunk/pgadmin3/src/pgAdmin3.cpp
Log:
Oopsie. If you try to autoconnect to a database that doesn't exist (or
is stopped), pgadmin will happily crash. Attached patch fixes this.
[Magnus Hagander]

Modified: trunk/pgadmin3/src/pgAdmin3.cpp
===================================================================
--- trunk/pgadmin3/src/pgAdmin3.cpp    2006-01-11 09:19:12 UTC (rev 4887)
+++ trunk/pgadmin3/src/pgAdmin3.cpp    2006-01-11 09:23:37 UTC (rev 4888)
@@ -419,8 +419,13 @@
             pgServer *srv = winMain->ConnectToServer(str, !cmdParser.Found(wxT("q")));
             if (srv && cmdParser.Found(wxT("q")))
             {
-                frmQuery *fq = new frmQuery(winMain, wxEmptyString, srv->CreateConn(), wxString(wxT("")));
-                fq->Go();
+                pgConn *conn;
+                conn = srv->CreateConn();
+                if (conn)
+                {
+                    frmQuery *fq = new frmQuery(winMain, wxEmptyString, conn, wxString(wxT("")));
+                    fq->Go();
+                }
             }
         }



pgadmin-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: Copy quoting
Next
From: "Dave Page"
Date:
Subject: Re: Commandline patch oops