If the ShortViewService is not found, don't crash.

This commit is contained in:
j2blake 2012-06-21 19:37:33 +00:00
parent 2a73c96b1d
commit f839583068

View file

@ -82,6 +82,11 @@ public class IndividualShortViewDirective extends BaseTemplateDirectiveModel {
VitroRequest vreq = new VitroRequest( VitroRequest vreq = new VitroRequest(
(HttpServletRequest) env.getCustomAttribute("request")); (HttpServletRequest) env.getCustomAttribute("request"));
ShortViewService svs = ShortViewServiceSetup.getService(ctx); ShortViewService svs = ShortViewServiceSetup.getService(ctx);
if (svs == null) {
log.warn("ShortViewService was not initialized properly.");
return;
}
TemplateAndSupplementalData svInfo = svs.getShortViewInfo(individual, TemplateAndSupplementalData svInfo = svs.getShortViewInfo(individual,
svContext, vreq); svContext, vreq);