Skip to content

Commit

Permalink
avoid NPE for files without class attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
PStellmann committed Feb 7, 2017
1 parent abaa966 commit 92a2419
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions java/base/src/org/DitaSemia/Base/DocumentCaching/FileCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,12 @@ private void writeHddCache(String fileHddCachePath, String fileTimestamp) {
writer.writeAttribute(HC_ATTR_SYSTEM_ID, source.getSystemId());
writer.writeAttribute(HC_ATTR_TIMESTAMP, fileTimestamp);
writer.writeAttribute(HC_ATTR_ROOT_NAME, rootName);
writer.writeAttribute(HC_ATTR_ROOT_CLASS, rootClass);
writer.writeAttribute(HC_ATTR_ROOT_TITLE, rootTitle);
if (rootClass != null) {
writer.writeAttribute(HC_ATTR_ROOT_CLASS, rootClass);
}
if (rootTitle != null) {
writer.writeAttribute(HC_ATTR_ROOT_TITLE, rootTitle);
}

for (ContainedXsltConref containedXsltConref : containedXsltConrefs) {
containedXsltConref.writeDependencyToHddCache(writer);
Expand Down Expand Up @@ -314,7 +318,7 @@ public String getLinkText(String refId, NodeWrapper contextNode) {
}

private String getRootLinkText() {
if (rootClass.contains(DitaUtil.CLASS_TOPIC)) {
if ((rootClass != null) && (rootClass.contains(DitaUtil.CLASS_TOPIC))) {
initRootTopicNum();
if (rootTopicNumPrefix != null) {
final StringBuffer linkText = new StringBuffer();
Expand Down

0 comments on commit 92a2419

Please sign in to comment.