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
|
throws Exception
|
||||||
{
|
{
|
||||||
super.initialize(rsvc);
|
super.initialize(rsvc);
|
||||||
rsvc.getLog().info("SCRM initializing.");
|
|
||||||
|
|
||||||
// the web framework was kind enough to slip this into the runtime when it started up
|
// 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);
|
||||||
@@ -45,7 +44,9 @@ public class ServletContextResourceManager extends ResourceManagerImpl
|
|||||||
rsvc.getLog().warn("SCRM: No application was initialized. A user of the " +
|
rsvc.getLog().warn("SCRM: No application was initialized. A user of the " +
|
||||||
"servlet context resource manager must ensure that " +
|
"servlet context resource manager must ensure that " +
|
||||||
"an application is instantiated and initialized.");
|
"an application is instantiated and initialized.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
rsvc.getLog().info("SCRM initializing.");
|
||||||
|
|
||||||
// create our resource loader
|
// create our resource loader
|
||||||
_contextLoader = new ServletContextResourceLoader(app.getServletContext());
|
_contextLoader = new ServletContextResourceLoader(app.getServletContext());
|
||||||
|
|||||||
@@ -46,16 +46,16 @@ public class SiteResourceManager extends ResourceManagerImpl
|
|||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
super.initialize(rsvc);
|
super.initialize(rsvc);
|
||||||
Log.log.info("SiteResourceManager initializing.");
|
|
||||||
|
|
||||||
// the web framework was kind enough to slip this into the runtime when it started up
|
// the web framework was kind enough to slip this into the runtime when it started up
|
||||||
Application app = (Application)rsvc.getApplicationAttribute(
|
Application app = (Application)rsvc.getApplicationAttribute(Application.VELOCITY_ATTR_KEY);
|
||||||
Application.VELOCITY_ATTR_KEY);
|
|
||||||
if (app == null) {
|
if (app == null) {
|
||||||
Log.log.warning("SiteResourceManager: No application was initialized. " +
|
Log.log.warning("SiteResourceManager: No application was initialized. " +
|
||||||
"A user of the site resource manager must ensure that " +
|
"A user of the site resource manager must ensure that " +
|
||||||
"an application is instantiated and initialized.");
|
"an application is instantiated and initialized.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
Log.log.info("SiteResourceManager initializing.");
|
||||||
|
|
||||||
// get handles on the good stuff
|
// get handles on the good stuff
|
||||||
_sctx = app.getServletContext();
|
_sctx = app.getServletContext();
|
||||||
|
|||||||
Reference in New Issue
Block a user