summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/base
diff options
context:
space:
mode:
authorRobert Antoni Buj i Gelonch <robert.buj@gmail.com>2014-10-01 21:12:34 +0200
committerMichael Stahl <mstahl@redhat.com>2014-10-01 20:06:44 +0000
commit58d07a1e9574c1ecdd09e924357caaebc82cac62 (patch)
treee3157f3e691024c9e51e27ee0bb49365487da022 /qadevOOo/runner/base
parentaf046d12d27bc4f87a3c0142dba749d21c8eec7d (diff)
runner: Avoid a possible NullPointerException with tCase Object
Change-Id: Ie1202b7fa89306ea2a99031b9347b657039b839e Reviewed-on: https://gerrit.libreoffice.org/11750 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'qadevOOo/runner/base')
-rw-r--r--qadevOOo/runner/base/java_fat_service.java35
1 files changed, 14 insertions, 21 deletions
diff --git a/qadevOOo/runner/base/java_fat_service.java b/qadevOOo/runner/base/java_fat_service.java
index f9eefaa41dac..27ae90a7368c 100644
--- a/qadevOOo/runner/base/java_fat_service.java
+++ b/qadevOOo/runner/base/java_fat_service.java
@@ -217,32 +217,25 @@ public class java_fat_service implements TestBase {
log = (LogWriter)dcl.getInstance((String)param.get("LogWriter"));
param.getMSF();
- TestCase tCase = null;
+ TestEnvironment tEnv = null;
- try
- {
- tCase = (TestCase) dcl.getInstance("mod._"+entry.entryName);
- }
- catch (java.lang.IllegalArgumentException ie)
- {
+ try {
+ TestCase tCase = (TestCase) dcl.getInstance("mod._"+entry.entryName);
+ log.println("Creating: " + tCase.getObjectName());
+ log.initialize(entry, true);
+ entry.UserDefinedParams = param;
+ tCase.setLogWriter((PrintWriter) log);
+ try {
+ tCase.initializeTestCase(param);
+ tEnv = tCase.getTestEnvironment(param);
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Office disposed");
+ }
+ } catch (java.lang.IllegalArgumentException ie) {
entry.ErrorMsg=ie.getMessage();
entry.hasErrorMsg=true;
}
- log.println("Creating: "+tCase.getObjectName());
- log.initialize(entry,true);
- entry.UserDefinedParams = param;
- tCase.setLogWriter((PrintWriter) log);
- TestEnvironment tEnv = null;
- try
- {
- tCase.initializeTestCase(param);
- tEnv = tCase.getTestEnvironment(param);
- }
- catch (com.sun.star.lang.DisposedException de)
- {
- log.println("Office disposed");
- }
return tEnv;
}