summaryrefslogtreecommitdiff
path: root/qadevOOo/tests
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-01-20 17:36:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-01-20 19:08:34 +0000
commit16255e485e0000985a139240a09c78a489e14786 (patch)
treec53d7afd226c15bf138f6df161f568e5565b4ed1 /qadevOOo/tests
parent13b1c4a684b2c344660e1e9caaa4b4e667ca65a9 (diff)
coverity#1326418 Dereference null return value
Change-Id: I5910518d0ae672232b00915a2437a5881dfa5f16
Diffstat (limited to 'qadevOOo/tests')
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java b/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java
index 2031ca3c3e86..60d55627b001 100644
--- a/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java
+++ b/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java
@@ -188,19 +188,20 @@ public class _XDocumentTemplates extends MultiMethodTest {
* Returns the string representation of content passed as parameter.
*/
protected String getContentList(XContent content) {
- XResultSet statRes = getStatResultSet(content);
StringBuilder ret = new StringBuilder();
- try {
- statRes.first();
- XRow row = UnoRuntime.queryInterface(XRow.class, statRes);
- while(! statRes.isAfterLast()) {
- ret.append("\n ").append(row.getString(1));
- statRes.next();
+ XResultSet statRes = getStatResultSet(content);
+ if (statRes != null) {
+ try {
+ statRes.first();
+ XRow row = UnoRuntime.queryInterface(XRow.class, statRes);
+ while(! statRes.isAfterLast()) {
+ ret.append("\n ").append(row.getString(1));
+ statRes.next();
+ }
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("Exception occurred:" + e);
}
- } catch (com.sun.star.sdbc.SQLException e) {
- log.println("Exception occurred:" + e);
}
-
return ret.toString();
}