From 3a31dfe01db0607d3b1b7676a7bc6e96178eee6d Mon Sep 17 00:00:00 2001 From: Edoardo Vacchi Date: Fri, 13 Sep 2013 09:11:04 +0200 Subject: [PATCH] NullPointerException in TableQuery.fetchMetadata() (#11403) Trivial patch. The finally block lacks a check for null before attempting to invoke table.close() Change-Id: Ib32f1d75fef4bd442652ca60a2b7df6aa45d7fa7 --- .../com/vaadin/data/util/sqlcontainer/query/TableQuery.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java b/server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java index 39c8365076..b54a630e04 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java @@ -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) { } } -- 2.39.5