diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-06 10:37:09 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-06 12:16:06 +0000 |
commit | 199fd5ce980e1a14db5a07fb8c565de2aea72ccd (patch) | |
tree | 1c289dcc2bbb39cff42facb05d526f5d9d56d6cc /qadevOOo | |
parent | 8366909cd1ff58aa00f82565eb83c8af47672339 (diff) |
coverity#1326560 Dereference before null check
Change-Id: Id4892ad9cfe53f00d8b20babd34ae46807ce833b
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/tests/java/mod/_sw/SwXTextDocument.java | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java b/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java index ef93bddefa25..75ffd622d6dd 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java @@ -181,23 +181,15 @@ public class SwXTextDocument extends TestCase { log.println("creating a second textdocument"); xSecondTextDoc = WriterTools.createTextDoc(Param.getMSF()); - if (xTextDoc != null) { - log.println("Creating instance..."); + XText oText2 = xTextDoc.getText(); + XTextCursor oTextCursor = oText2.createTextCursor(); - XText oText2 = xTextDoc.getText(); - XTextCursor oTextCursor = oText2.createTextCursor(); - - for (int i = 0; i < 11; i++) { - oText2.insertString(oTextCursor, "xTextDoc ", false); - } - - tEnv = new TestEnvironment(xTextDoc); - } else { - log.println("Failed to create instance."); - - return tEnv; + for (int i = 0; i < 11; i++) { + oText2.insertString(oTextCursor, "xTextDoc ", false); } + tEnv = new TestEnvironment(xTextDoc); + XModel model1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XModel model2 = UnoRuntime.queryInterface(XModel.class, xSecondTextDoc); |