ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r675911 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
Date Fri, 11 Jul 2008 10:40:44 GMT
Author: bodewig
Date: Fri Jul 11 03:40:44 2008
New Revision: 675911

URL: http://svn.apache.org/viewvc?rev=675911&view=rev
Log:
Avoid NPE if database doesn't match expected vendor

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java?rev=675911&r1=675910&r2=675911&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java Fri Jul 11 03:40:44
2008
@@ -436,6 +436,11 @@
             t.setSrc(srcFile);
             t.addText(sqlCommand);
 
+            if (getConnection() == null) {
+                // not a valid rdbms
+                return;
+            }
+
             try {
                 PrintStream out = System.out;
                 try {



Mime
View raw message