[ https://issues.apache.org/struts/browse/STR-2433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Benedict updated STR-2433: ------------------------------- Fix Version/s: 1.4.0 Assignee: (was: Struts Developers) > Specify which module is causing an error in ModuleUtils.selectModule() > ---------------------------------------------------------------------- > > Key: STR-2433 > URL: https://issues.apache.org/struts/browse/STR-2433 > Project: Struts 1 > Issue Type: Improvement > Components: Core > Affects Versions: 1.2.4 > Environment: Operating System: other > Platform: Other > Reporter: Jefferson Hunt > Priority: Minor > Fix For: 1.4.0 > > > A null pointer exception is thrown if the module config is not found the > following code from ModuleUtils.selectModule. > It appears as if the config is null a informative exception should be thrown > instead of continuing processing at line 250 with > config.findMessageResourcesConfigs() which results in a null pointer > exception. > At the very least a log message of "config not found for prefix "+prefix would > be helpful. > Code from ModuleUtils.selectModule : > // Expose the resources for this module > ModuleConfig config = getModuleConfig(prefix, context); > if (config != null) { > request.setAttribute(Globals.MODULE_KEY, config); > } else { > request.removeAttribute(Globals.MODULE_KEY); > } > MessageResourcesConfig[] mrConfig = > config.findMessageResourcesConfigs(); > for(int i = 0; i < mrConfig.length; i++) { > String key = mrConfig[i].getKey(); > MessageResources resources = > (MessageResources) context.getAttribute(key + prefix); > if (resources != null) { > request.setAttribute(key, resources); > } else { > request.removeAttribute(key); > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.