[jboss-svn-commits] JBL Code SVN: r7252 - labs/jbossforums/branches/forums26/forums/src/main/org/jboss/portlet/forums/ui/action
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Oct 31 16:33:32 EST 2006
Author: unibrew
Date: 2006-10-31 16:33:29 -0500 (Tue, 31 Oct 2006)
New Revision: 7252
Modified:
labs/jbossforums/branches/forums26/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java
Log:
[JBFORUMS-138] Deleting category and forum doesn't throw any exceptions to the log any longer.
Modified: labs/jbossforums/branches/forums26/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java
===================================================================
--- labs/jbossforums/branches/forums26/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java 2006-10-31 20:40:25 UTC (rev 7251)
+++ labs/jbossforums/branches/forums26/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java 2006-10-31 21:33:29 UTC (rev 7252)
@@ -23,8 +23,8 @@
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.Collection;
+import org.jboss.portal.core.modules.ModuleException;
import org.jboss.portlet.forums.ui.*;
import org.jboss.portlet.forums.model.Category;
@@ -166,8 +166,15 @@
}
if(categoryId!=-1)
{
- Category category = BaseController.getForumsModule().findCategoryById(new Integer(categoryId));
- this.categoryName = category.getTitle();
+ Category category = null;
+ try {
+ category = BaseController.getForumsModule().findCategoryById(new Integer(categoryId));
+ } catch (ModuleException e) {
+ // Category was deleted
+ }
+ if (category!=null) {
+ this.categoryName = category.getTitle();
+ }
}
//load the selected forum is a forumid is found
@@ -180,10 +187,17 @@
}
if(forumId!=-1)
{
- Forum forum = BaseController.getForumsModule().findForumById(new Integer(forumId));
- this.forumName = forum.getName();
- this.forumDescription = forum.getDescription();
- this.selectedCategory = forum.getCategory().getId().intValue();
+ Forum forum = null;
+ try {
+ forum = BaseController.getForumsModule().findForumById(new Integer(forumId));
+ } catch (ModuleException e) {
+ // Forum was deleted
+ }
+ if (forum!=null) {
+ this.forumName = forum.getName();
+ this.forumDescription = forum.getDescription();
+ this.selectedCategory = forum.getCategory().getId().intValue();
+ }
}
}
catch(Exception e)
More information about the jboss-svn-commits
mailing list