[jboss-svn-commits] JBL Code SVN: r7253 - labs/jbossforums/trunk/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:36:13 EST 2006


Author: unibrew
Date: 2006-10-31 16:36:11 -0500 (Tue, 31 Oct 2006)
New Revision: 7253

Modified:
   labs/jbossforums/trunk/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/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java
===================================================================
--- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java	2006-10-31 21:33:29 UTC (rev 7252)
+++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java	2006-10-31 21:36:11 UTC (rev 7253)
@@ -25,6 +25,7 @@
 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 +167,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 +188,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