roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r372964 - /incubator/roller/trunk/src/org/roller/presentation/filters/RefererFilter.java
Date Fri, 27 Jan 2006 20:05:35 GMT
Author: agilliland
Date: Fri Jan 27 12:05:30 2006
New Revision: 372964

URL: http://svn.apache.org/viewcvs?rev=372964&view=rev
Log:
check that the weblog being referenced actually exists to prevent a null pointer once we pass
things on to the SpamChecker.


Modified:
    incubator/roller/trunk/src/org/roller/presentation/filters/RefererFilter.java

Modified: incubator/roller/trunk/src/org/roller/presentation/filters/RefererFilter.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/filters/RefererFilter.java?rev=372964&r1=372963&r2=372964&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/filters/RefererFilter.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/filters/RefererFilter.java Fri Jan
27 12:05:30 2006
@@ -12,6 +12,7 @@
 import javax.servlet.http.HttpServletResponse;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.roller.RollerException;
 import org.roller.business.referrers.IncomingReferrer;
 import org.roller.business.referrers.ReferrerQueueManager;
 import org.roller.model.RollerFactory;
@@ -107,6 +108,10 @@
                 try {
                     UserManager userMgr = RollerFactory.getRoller().getUserManager();
                     weblog = userMgr.getWebsiteByHandle(handle);
+                    
+                    if(weblog == null) {
+                        throw new RollerException("invalid website: "+handle);
+                    }
                 } catch(Exception e) {
                     // if we can't get the WebsiteData object we can't continue
                     response.sendError(HttpServletResponse.SC_NOT_FOUND);



Mime
View raw message