summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/helper
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-10-14 17:20:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-10-15 11:38:53 +0100
commit940c9ef2c00485b46eaf6a7d0d0f4d18457c4fc3 (patch)
treedcf378a1e6ecd5900f02101892af6d98ff11d19d /qadevOOo/runner/helper
parent9c819f14ceef683c6921f24945a506f1a09c86ce (diff)
coverity#1326405 Dereference null return value
Change-Id: I278c7c2516fde01355abe3030733a5798e1c96c2
Diffstat (limited to 'qadevOOo/runner/helper')
-rw-r--r--qadevOOo/runner/helper/OfficeProvider.java28
1 files changed, 8 insertions, 20 deletions
diff --git a/qadevOOo/runner/helper/OfficeProvider.java b/qadevOOo/runner/helper/OfficeProvider.java
index 3f37c57fc747..6d03e5d5a031 100644
--- a/qadevOOo/runner/helper/OfficeProvider.java
+++ b/qadevOOo/runner/helper/OfficeProvider.java
@@ -88,6 +88,11 @@ public class OfficeProvider implements AppProvider
{
System.out.println("User Variable '$(user)' not defined.");
}
+ catch (com.sun.star.uno.Exception e)
+ {
+ System.out.println("Couldn't backup user layer");
+ e.printStackTrace();
+ }
catch (java.io.IOException e)
{
System.out.println("Couldn't backup user layer");
@@ -578,28 +583,11 @@ public class OfficeProvider implements AppProvider
return res;
}
- private static XStringSubstitution createStringSubstitution(XMultiServiceFactory xMSF)
+ private static XStringSubstitution createStringSubstitution(XMultiServiceFactory xMSF) throws com.sun.star.uno.Exception
{
- Object xPathSubst = null;
-
- try
- {
- xPathSubst = xMSF.createInstance(
+ Object xPathSubst = xMSF.createInstance(
"com.sun.star.util.PathSubstitution");
- }
- catch (com.sun.star.uno.Exception e)
- {
- e.printStackTrace();
- }
-
- if (xPathSubst != null)
- {
- return UnoRuntime.queryInterface(XStringSubstitution.class, xPathSubst);
- }
- else
- {
- return null;
- }
+ return UnoRuntime.queryInterface(XStringSubstitution.class, xPathSubst);
}
/**