예제 #1
0
 public Topic getTopicById(boolean flag, Long id) {
   try {
     Topic topic = forumManager.getTopicById(flag, id);
     if (topic == null) return null;
     // the purpose of this is to trigger a null pointer error if the forum doesn't exist
     // if you delete the forum, it doesn't delete the topics, but showing a topic without
     // its forum causes confusion. The /direct code does the following, so it will give
     // an error.
     if (topic.getOpenForum().getArea() == null) return null;
     return topic;
   } catch (Exception e) {
     return null;
   }
 }