Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookOutputFactory.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookOutputFactory.java,v diff -u -r1.3 -r1.4 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookOutputFactory.java 31 Oct 2008 05:57:26 -0000 1.3 +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookOutputFactory.java 27 Mar 2009 03:16:35 -0000 1.4 @@ -41,7 +41,8 @@ import org.lamsfoundation.lams.tool.notebook.util.NotebookConstants; /** - * Output factory for Notebook tool. Currently it provides only one type of output - the entry that user provided. + * Output factory for Notebook tool. Currently it provides only one type of + * output - the entry that user provided. * * @author Marcin Cieslak */ @@ -125,12 +126,14 @@ Notebook notebook = chatService.getSessionBySessionId(toolSessionId).getNotebook(); NotebookUser user = chatService.getUserByUserIdAndSessionId(learnerId, toolSessionId); - NotebookEntry entry = chatService.getEntry(user.getEntryUID()); - String value = entry == null ? null : entry.getEntry(); + if (user != null) { + NotebookEntry entry = chatService.getEntry(user.getEntryUID()); - return new ToolOutput(name, getI18NText(NotebookConstants.TEXT_SEARCH_DEFINITION_NAME, true), value); + String value = entry == null ? null : entry.getEntry(); + return new ToolOutput(name, getI18NText(NotebookConstants.TEXT_SEARCH_DEFINITION_NAME, true), value); + } } return null; } @@ -149,7 +152,8 @@ } /** - * Creates a default condition so teachers know how to use complex conditions for this tool. + * Creates a default condition so teachers know how to use complex + * conditions for this tool. * * @param notebook * content of the tool