Author: markt Date: Tue Jan 12 12:03:07 2010 New Revision: 898297 URL: http://svn.apache.org/viewvc?rev=898297&view=rev Log: Avoid NPE if bundle is missing
Modified: tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java Modified: tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java?rev=898297&r1=898296&r2=898297&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java Tue Jan 12 12:03:07 2010 @@ -109,7 +109,10 @@ String str = null; try { - str = bundle.getString(key); + // Avoid NPE if bundle is null and treat it like an MRE + if (bundle != null) { + str = bundle.getString(key); + } } catch(MissingResourceException mre) { //bad: shouldn't mask an exception the following way: // str = "[cannot find message associated with key '" + key + "' due to " + mre + "]"; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org