From 1a84fb8f92ea941214fc9d3a6773aabcfca865e2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 4 Feb 2016 10:55:38 +0000 Subject: coverity#1326388 Dereference null return value Change-Id: I08955a20e0566f56701bef85a4a9d4de79ca7b1f --- qadevOOo/runner/util/utils.java | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'qadevOOo') diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java index 8582f5f24010..4788e3eae689 100644 --- a/qadevOOo/runner/util/utils.java +++ b/qadevOOo/runner/util/utils.java @@ -193,10 +193,6 @@ public class utils { return fulldocURL; } - - - - /** * * This method get's the user dir of the connected office @@ -229,22 +225,15 @@ public class utils { * @return the value as String */ private static String getOfficeSettingsValue(XMultiServiceFactory msf, String setting) { - - String settingPath = null; try { Object settings = msf.createInstance("com.sun.star.comp.framework.PathSettings"); - try { - XPropertySet pthSettings = (XPropertySet) AnyConverter.toObject( - new Type(XPropertySet.class), settings); - settingPath = (String) pthSettings.getPropertyValue(setting); - } catch (com.sun.star.lang.IllegalArgumentException iae) { - System.out.println("### couldn't get Office Settings"); - } - } catch (Exception e) { - System.out.println("Couldn't get string value for " + setting); + XPropertySet pthSettings = (XPropertySet) AnyConverter.toObject( + new Type(XPropertySet.class), settings); + return (String) pthSettings.getPropertyValue(setting); + } catch (com.sun.star.uno.Exception e) { e.printStackTrace(); + throw new RuntimeException(e); } - return settingPath; } /** -- cgit