roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eli...@apache.org
Subject svn commit: r466134 - /incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/PreviewResourceServlet.java
Date Fri, 20 Oct 2006 14:54:51 GMT
Author: eliast
Date: Fri Oct 20 07:54:50 2006
New Revision: 466134

URL: http://svn.apache.org/viewvc?view=rev&rev=466134
Log:
- Avoiding NPE (same as earlier fix for ResourceServlet)

Modified:
    incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/PreviewResourceServlet.java

Modified: incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/PreviewResourceServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/PreviewResourceServlet.java?view=diff&rev=466134&r1=466133&r2=466134
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/PreviewResourceServlet.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/PreviewResourceServlet.java
Fri Oct 20 07:54:50 2006
@@ -116,8 +116,10 @@
                 ThemeManager themeMgr = RollerFactory.getRoller().getThemeManager();
                 Theme weblogTheme = themeMgr.getTheme(weblog.getEditorTheme());
                 File resource = weblogTheme.getResource(resourceRequest.getResourcePath());
-                resourceLastMod = resource.lastModified();
-                resourceStream = new FileInputStream(resource);
+                if(resource != null) {
+                    resourceLastMod = resource.lastModified();
+                    resourceStream = new FileInputStream(resource);
+                }
             } catch (Exception ex) {
                 // hmmm, some kind of error getting theme.  that's an error.
                 response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);



Mime
View raw message