Skip to content

Commit

Permalink
#10233 Clean up stringbuf on each iteration and avoid writting wrong …
Browse files Browse the repository at this point in the history
…lines to the xml file
  • Loading branch information
nollymar committed May 17, 2017
1 parent 56146bd commit da79b25
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ public void generateSitemapPerHost() throws DotDataException, DotSecurityExcepti
}

for (Contentlet contenlet : hits) {
stringbuf = null;
try {
if (usePermalinks) {
stringbuf = "<url><loc>"
Expand Down Expand Up @@ -333,7 +334,10 @@ public void generateSitemapPerHost() throws DotDataException, DotSecurityExcepti
+ modifiedDateStringValue
+ "</lastmod><changefreq>daily</changefreq></url>\n";
}
writeFile(stringbuf);

if (stringbuf != null) {
writeFile(stringbuf);
}
addRegistryProcessed();

} catch (Exception e) {
Expand Down

0 comments on commit da79b25

Please sign in to comment.