Author: mmillson
Date: 2010-08-20 11:16:04 -0400 (Fri, 20 Aug 2010)
New Revision: 1540
Modified:
branches/JBOSSWEB_2_0_0_GA_CP13_JBPAPP-4921/src/share/classes/org/apache/catalina/session/StandardSession.java
Log:
Fix session attribute NullPointerException for [JBPAPP-4921].
Modified:
branches/JBOSSWEB_2_0_0_GA_CP13_JBPAPP-4921/src/share/classes/org/apache/catalina/session/StandardSession.java
===================================================================
---
branches/JBOSSWEB_2_0_0_GA_CP13_JBPAPP-4921/src/share/classes/org/apache/catalina/session/StandardSession.java 2010-08-20
15:02:11 UTC (rev 1539)
+++
branches/JBOSSWEB_2_0_0_GA_CP13_JBPAPP-4921/src/share/classes/org/apache/catalina/session/StandardSession.java 2010-08-20
15:16:04 UTC (rev 1540)
@@ -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);
Show replies by date