Author: mmillson
Date: 2010-08-16 22:14:12 -0400 (Mon, 16 Aug 2010)
New Revision: 1530
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/session/StandardSession.java
Log:
Fix session attribute NullPointerException for [JBPAPP-4890].
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/session/StandardSession.java
===================================================================
---
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/session/StandardSession.java 2010-08-17
01:53:25 UTC (rev 1529)
+++
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/session/StandardSession.java 2010-08-17
02:14:12 UTC (rev 1530)
@@ -1032,6 +1032,10 @@
throw new IllegalStateException
(sm.getString("standardSession.getAttribute.ise"));
+ if (name == null) {
+ return null;
+ }
+
return (attributes.get(name));
}
@@ -1634,6 +1638,9 @@
*/
protected void removeAttributeInternal(String name, boolean notify) {
+ // Avoid NPE
+ if (name == null) return;
+
// Remove this attribute from our collection
Object value = attributes.remove(name);