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();
+ }
}
}