diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-03-01 10:53:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-03-01 10:53:55 +0000 |
commit | 2fb8c4b642bae77e0a515512450129503db5aa38 (patch) | |
tree | d9d9928f078fe7d560cfa4bab5269d04b70a9408 /wizards/com/sun/star | |
parent | 16067d4f903bebc506daa8149f9b15f1f1b4e629 (diff) |
coverity#1326385 Dereference null return value
Change-Id: I0097e9759c1ac3a1e03d9c2741c109e147dce540
Diffstat (limited to 'wizards/com/sun/star')
-rw-r--r-- | wizards/com/sun/star/wizards/db/SQLQueryComposer.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java index e6e8c622f076..d169f7dd951a 100644 --- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java +++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java @@ -242,13 +242,16 @@ public class SQLQueryComposer } } - public StringBuilder getFromClause() + public StringBuilder getFromClause() throws SQLException { StringBuilder sFromClause = new StringBuilder("FROM"); String[] sCommandNames = CurDBMetaData.getIncludedCommandNames(); for (int i = 0; i < sCommandNames.length; i++) { CommandName curCommandName = getComposedCommandByDisplayName(sCommandNames[i]); + if (curCommandName == null) { + throw new SQLException("Error: CommandName unavailable"); + } sFromClause.append(" ").append(curCommandName.getComposedName()).append(" ").append(quoteName(curCommandName.getAliasName())); if (i < sCommandNames.length - 1) { |