Fixed NullPointerException when create HTML with null HTML extension

This commit is contained in:
Elaine Tan 2012-09-21 17:38:01 +08:00
parent f22faccda1
commit e963fea9dc
1 changed files with 2 additions and 2 deletions

View File

@ -703,12 +703,12 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
{ {
XhtmlDocument doc = new XhtmlDocument(); XhtmlDocument doc = new XhtmlDocument();
doc.appendBody(table); doc.appendBody(table);
if (extension.getStyleURL() != null) if (extension != null && extension.getStyleURL() != null)
{ {
link l = new link(extension.getStyleURL(), "stylesheet", "text/css"); link l = new link(extension.getStyleURL(), "stylesheet", "text/css");
doc.appendHead(l); doc.appendHead(l);
} }
if (extension.getScriptURL() != null) if (extension != null && extension.getScriptURL() != null)
{ {
script jslink = new script(); script jslink = new script();
jslink.setLanguage("javascript"); jslink.setLanguage("javascript");