summaryrefslogtreecommitdiff
path: root/xmerge
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-02-16 11:43:57 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-02-16 12:28:47 +0000
commit7cdb46536db710d1173f410d02f3c49674939db8 (patch)
tree14e3aa1185000d3eae4a540e1ae1aa986a09582a /xmerge
parentf359cbc665f34540213b7b28e8a72c755e22dbd1 (diff)
coverity#1326425 Dereference null return value
Change-Id: I034a110457d1fa20c392e6660874077def125edd
Diffstat (limited to 'xmerge')
-rw-r--r--xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java
index 501059f9a979..9cf294237a89 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java
@@ -469,15 +469,20 @@ public abstract class SxcDocumentSerializer implements OfficeConstants,
Debug.log(Debug.TRACE, "traverseColumn() default-cell-style : " + cellStyleName);
}
+ CellStyle cellStyle = null;
+
if(cellStyleName.equalsIgnoreCase("Default") || cellStyleName.length()==0) {
Debug.log(Debug.TRACE, "No default cell Style Attribute was found");
} else {
- CellStyle cellStyle = (CellStyle)styleCat.lookup(cellStyleName,
+ cellStyle = (CellStyle)styleCat.lookup(cellStyleName,
SxcConstants.TABLE_CELL_STYLE_FAMILY, null,
CellStyle.class);
+ }
+
+ if (cellStyle != null) {
Format defaultFmt = new Format(cellStyle.getFormat());
col.setFormat(defaultFmt);
}