Author: [EMAIL PROTECTED]
Date: Fri Oct 3 08:44:12 2008
New Revision: 2745
Modified:
trunk/src/ca/sqlpower/architect/swingui/query/SQLQueryEntryPanel.java
Log:
Fixed a NPE on the execute button when no database is selected
Modified:
trunk/src/ca/sqlpower/architect/swingui/query/SQLQueryEntryPanel.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/query/SQLQueryEntryPanel.java
(original)
+++ trunk/src/ca/sqlpower/architect/swingui/query/SQLQueryEntryPanel.java
Fri Oct 3 08:44:12 2008
@@ -343,8 +343,10 @@
public void actionPerformed(ActionEvent e) {
ConnectionAndStatementBean conBean =
conMap.get(databases.getSelectedItem());
try {
- if (!conBean.getConnection().getAutoCommit()) {
- conBean.setConnectionUncommitted(true);
+ if(conBean!= null) {
+ if (!conBean.getConnection().getAutoCommit()) {
+ conBean.setConnectionUncommitted(true);
+ }
}
} catch (SQLException e1) {
SPSUtils.showExceptionDialogNoReport(parent,
Messages.getString("SQLQuery.failedRetrievingConnection",
((SPDataSource)databases.getSelectedItem()).getName()), e1);
@@ -534,6 +536,7 @@
((JToggleButton)e.getSource()).setSelected(con.getAutoCommit());
return;
}
+
}
con.setAutoCommit(isPressed);