]> source.dussan.org Git - vaadin-framework.git/commitdiff
NullPointerException in TableQuery.fetchMetadata() (#11403)
authorEdoardo Vacchi <uncommonnonsense@gmail.com>
Fri, 13 Sep 2013 07:11:04 +0000 (09:11 +0200)
committerEdoardo Vacchi <edoardo.vacchi@gmail.com>
Fri, 13 Sep 2013 08:27:15 +0000 (08:27 +0000)
Trivial patch. The finally block lacks a check for null before
attempting to invoke table.close()

Change-Id: Ib32f1d75fef4bd442652ca60a2b7df6aa45d7fa7

server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java

index 39c8365076b05d3d307428b2677c5f495bdbf48a..b54a630e0447eda5df07a2020434ba81f7959d5f 100644 (file)
@@ -663,7 +663,9 @@ public class TableQuery extends AbstractTransactionalQuery implements
             } catch (SQLException ignore) {
             } finally {
                 try {
-                    tables.close();
+                    if (tables != null) {
+                        tables.close();
+                    }
                 } catch (SQLException ignore) {
                 }
             }