diff options
author | Raymond Auge | 2015-06-11 18:34:06 +0000 |
---|---|---|
committer | Raymond Auge | 2015-07-02 03:08:34 +0000 |
commit | 9617717b1b3ad2feb417c07e35db169c041394c1 (patch) | |
tree | 7356842bf2628dad535f0165fbcb11b551a422f8 /bundles | |
parent | a7d895eec59646516a89bfe020b23546cd7f3c1e (diff) | |
download | rt.equinox.bundles-9617717b1b3ad2feb417c07e35db169c041394c1.tar.gz rt.equinox.bundles-9617717b1b3ad2feb417c07e35db169c041394c1.tar.xz rt.equinox.bundles-9617717b1b3ad2feb417c07e35db169c041394c1.zip |
Bug 469988 - [http] calling servletContext.setAttribute(name, null) causes NPE
Signed-off-by: Raymond Auge <raymond.auge@liferay.com>
Diffstat (limited to 'bundles')
-rw-r--r-- | bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java index e0f497df0..3430a2ba2 100644 --- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java +++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java @@ -299,7 +299,13 @@ public class ServletContextAdaptor { throw new UnsupportedOperationException(); } - public void setAttribute(String attributeName, Object attributeValue) { + public void setAttribute(String attributeName, Object attributeValue) { + if (attributeValue == null) { + removeAttribute(attributeName); + + return; + } + Dictionary<String, Object> attributes = getContextAttributes(); boolean added = (attributes.get(attributeName) == null); attributes.put(attributeName, attributeValue); |