anchor.diff:          nopermission = true;
   
       /* Strange error.  Entry is garbage */
  -    if (entry.getUserId() == 0)
  +    if (entry != null && entry.getUserId() == 0)
           nopermission = true;
   
       /* non-Entry owner is viewing a friends entry */
  -    if ((aUser == null || !aUser.equalsIgnoreCase(entry.getUserName())) &&
  -            entry.getSecurityLevel() == 1)
  +    assert entry != null;
  +    if ((aUser == null || !aUser.equalsIgnoreCase(entry.getUserName())) && entry.getSecurityLevel() == 1)
           nopermission = true;
   %>
   <?xml version="1.0" encoding="iso-8859-1"?>
  
positive.code: 
      String aUser = (String) session.getAttribute("auth.user");
  
      Collection comments = CommentDao.list(eid);
  
      EntryTo entry = EntryDAO.viewSingle(eid, true);
  
      User pf;
      try {
          pf = new User(entry.getUserName());
      } catch (Exception e) {
          response.reset();
          response.sendError(500, "Error loading entry owner preferences.");
          response.flushBuffer();
          return;
      }
  
      /* Error retrieving user preferences. */
      if (pf == null)
          nopermission = true;
  
      /* Entry owner wants a private journal. */
      if (pf != null && pf.isPrivateJournal())
          nopermission = true;
  
      /* Entry owner doesn't want comments on this entry. */
  
negative.code:             String tmpBody = entry.getBodyWithLinks();
      %>
      <p>
          <% if (tmpBody.contains("\n")) { %>
          <%=(StringUtil.replace(tmpBody, '\n', "<br />"))%>
          <% } else if (entry.getBody().contains("\r")) { %>
          <%=(StringUtil.replace(tmpBody, '\r', "<br />"))%>
          <% } else {
              // we do not have any "new lines" but it might be
  