Index: lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java =================================================================== diff -u -red0a9ce91d47d575397dbb3c8545a968a461bf49 -r9b0bf1af06d430bf42410223c72fd5670c1fcdb5 --- lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java (.../HelpTag.java) (revision ed0a9ce91d47d575397dbb3c8545a968a461bf49) +++ lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java (.../HelpTag.java) (revision 9b0bf1af06d430bf42410223c72fd5670c1fcdb5) @@ -23,6 +23,7 @@ package org.lamsfoundation.lams.web.tag; import java.io.IOException; +import java.lang.NullPointerException; import java.util.Locale; import javax.servlet.http.HttpServletRequest; @@ -77,28 +78,39 @@ JspWriter writer = pageContext.getOut(); - // retrieve help URL for tool - ILamsToolService toolService = (ILamsToolService) getContext().getBean(AuthoringConstants.TOOL_SERVICE_BEAN_NAME); - IToolVO tool = toolService.getToolBySignature(toolSig); - - helpURL = tool.getHelpUrl(); - - if(helpURL == null) - return SKIP_BODY; - - // construct link - - Locale locale = (Locale) session.getAttribute(LocaleFilter.PREFERRED_LOCALE_KEY); - if ( locale != null ) { - language = locale.getLanguage(); - country = locale.getCountry(); - } - - fullURL = helpURL + module + "#" + toolSig + module + "-" + language + country; - writer.println("
"); - writer.println(""); - writer.println("
"); - + try { + // retrieve help URL for tool + ILamsToolService toolService = (ILamsToolService) getContext().getBean(AuthoringConstants.TOOL_SERVICE_BEAN_NAME); + IToolVO tool = toolService.getToolBySignature(toolSig); + + helpURL = tool.getHelpUrl(); + + if(helpURL == null) + return SKIP_BODY; + + // construct link + + Locale locale = (Locale) session.getAttribute(LocaleFilter.PREFERRED_LOCALE_KEY); + if ( locale != null ) { + language = locale.getLanguage(); + country = locale.getCountry(); + } + + fullURL = helpURL + module + "#" + toolSig + module + "-" + language + country; + writer.println("
"); + writer.println(""); + writer.println("
"); + + } catch (NullPointerException npe) { + log.error("HelpTag unable to write out due to NullPointerException. Most likely your Tool Signature was incorrect.", npe); + // don't throw a JSPException as we want the system to still function. + + writer.println("
"); + writer.println(""); + writer.println("
"); + + } + } catch (IOException e) { log.error("HelpTag unable to write out due to IOException.", e); // don't throw a JSPException as we want the system to still function.