Kaydet (Commit) de024170 authored tarafından rbuj's avatar rbuj Kaydeden (comit) David Tardon

xmerge: Avoid a possible null pointer exception

Change-Id: Ib6ce07aef1ae27f4e5db376667617432de9f41ef
Reviewed-on: https://gerrit.libreoffice.org/10686Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst 2479db76
......@@ -182,17 +182,11 @@ public class DOMDocument
*/
public void read(InputStream is) throws IOException {
Debug.log(Debug.INFO, "reading file");
DocumentBuilder builder = null;
try {
builder = factory.newDocumentBuilder();
DocumentBuilder builder = factory.newDocumentBuilder();
contentDoc = builder.parse(is);
} catch (ParserConfigurationException ex) {
System.out.println("Error:"+ ex);
}
try {
contentDoc= builder.parse(is);
} catch (SAXException ex) {
System.out.println("Error:"+ ex);
}
......@@ -371,20 +365,14 @@ public class DOMDocument
Document doc = null;
try {
DocumentBuilder builder = factory.newDocumentBuilder();
doc = builder.newDocument();
Element root = doc.createElement(rootName);
doc.appendChild(root);
} catch (ParserConfigurationException ex) {
System.out.println("Error:"+ ex);
}
Element root = doc.createElement(rootName);
doc.appendChild(root);
return doc;
}
......
......@@ -81,14 +81,15 @@ public class ActiveSyncDriver {
* Because they can be installed separately, though, the MIME types need
* to be check to see which one to load.
*/
File pluginJar = null;
if (srcMime.equals("staroffice/sxw") || srcMime.equals("application/x-pocket-word"))
{
File pluginJar;
if (srcMime.equals("staroffice/sxw") || srcMime.equals("application/x-pocket-word")) {
pluginJar = new File(ooClassDir + "pocketWord.jar");
}
else if (srcMime.equals("staroffice/sxc") || srcMime.equals("application/x-pocket-excel"))
{
pluginJar = new File(ooClassDir + "pexcel.jar");
} else {
if (srcMime.equals("staroffice/sxc") || srcMime.equals("application/x-pocket-excel")) {
pluginJar = new File(ooClassDir + "pexcel.jar");
} else {
return false;
}
}
ConverterInfoReader cirPlugin = new ConverterInfoReader(pluginJar.toURI().toURL().toString(), false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment