Index: lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java,v diff -u -r1.3 -r1.4 --- lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java 22 Sep 2006 02:53:15 -0000 1.3 +++ lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java 26 Sep 2006 05:49:13 -0000 1.4 @@ -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("
"); - + 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(" "); + + } 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(" "); + + } + } 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.