Avoid NPE.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2712 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -37,7 +37,6 @@ public class ServletContextResourceManager extends ResourceManagerImpl
|
||||
throws Exception
|
||||
{
|
||||
super.initialize(rsvc);
|
||||
rsvc.getLog().info("SCRM initializing.");
|
||||
|
||||
// the web framework was kind enough to slip this into the runtime when it started up
|
||||
Application app = (Application)rsvc.getApplicationAttribute(Application.VELOCITY_ATTR_KEY);
|
||||
@@ -45,7 +44,9 @@ public class ServletContextResourceManager extends ResourceManagerImpl
|
||||
rsvc.getLog().warn("SCRM: No application was initialized. A user of the " +
|
||||
"servlet context resource manager must ensure that " +
|
||||
"an application is instantiated and initialized.");
|
||||
return;
|
||||
}
|
||||
rsvc.getLog().info("SCRM initializing.");
|
||||
|
||||
// create our resource loader
|
||||
_contextLoader = new ServletContextResourceLoader(app.getServletContext());
|
||||
|
||||
@@ -46,16 +46,16 @@ public class SiteResourceManager extends ResourceManagerImpl
|
||||
throws Exception
|
||||
{
|
||||
super.initialize(rsvc);
|
||||
Log.log.info("SiteResourceManager initializing.");
|
||||
|
||||
// the web framework was kind enough to slip this into the runtime when it started up
|
||||
Application app = (Application)rsvc.getApplicationAttribute(
|
||||
Application.VELOCITY_ATTR_KEY);
|
||||
Application app = (Application)rsvc.getApplicationAttribute(Application.VELOCITY_ATTR_KEY);
|
||||
if (app == null) {
|
||||
Log.log.warning("SiteResourceManager: No application was initialized. " +
|
||||
"A user of the site resource manager must ensure that " +
|
||||
"an application is instantiated and initialized.");
|
||||
return;
|
||||
}
|
||||
Log.log.info("SiteResourceManager initializing.");
|
||||
|
||||
// get handles on the good stuff
|
||||
_sctx = app.getServletContext();
|
||||
|
||||
Reference in New Issue
Block a user