roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eli...@apache.org
Subject svn commit: r518767 - /incubator/roller/trunk/src/org/apache/roller/business/search/operations/RebuildWebsiteIndexOperation.java
Date Thu, 15 Mar 2007 21:52:57 GMT
Author: eliast
Date: Thu Mar 15 14:52:55 2007
New Revision: 518767

URL: http://svn.apache.org/viewvc?view=rev&rev=518767
Log:
Fixing NPE in case of incosistent startup where this.website is null and we were trying to
call this.website.getId().

Modified:
    incubator/roller/trunk/src/org/apache/roller/business/search/operations/RebuildWebsiteIndexOperation.java

Modified: incubator/roller/trunk/src/org/apache/roller/business/search/operations/RebuildWebsiteIndexOperation.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/business/search/operations/RebuildWebsiteIndexOperation.java?view=diff&rev=518767&r1=518766&r2=518767
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/business/search/operations/RebuildWebsiteIndexOperation.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/business/search/operations/RebuildWebsiteIndexOperation.java
Thu Mar 15 14:52:55 2007
@@ -75,12 +75,14 @@
         // since this operation can be run on a separate thread we must treat
         // the weblog object passed in as a detached object which is proned to
         // lazy initialization problems, so requery for the object now
-        try {
-            UserManager uMgr = RollerFactory.getRoller().getUserManager();
-            this.website = uMgr.getWebsite(this.website.getId());
-        } catch (RollerException ex) {
-            mLogger.error("Error getting website object", ex);
-            return;
+        if(this.website != null) {
+            try {
+                UserManager uMgr = RollerFactory.getRoller().getUserManager();
+                this.website = uMgr.getWebsite(this.website.getId());
+            } catch (RollerException ex) {
+                mLogger.error("Error getting website object", ex);
+                return;
+            }
         }
         
         IndexReader reader = beginDeleting();



Mime
View raw message