Modified the setAttribute() method to remove the attribute
if the value is null instead of throwin an NPE. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7485 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
842260bf9c
commit
e6c9cbac12
@ -68,7 +68,8 @@ public interface HostedConnection extends MessageConnection
|
|||||||
public void close( String reason );
|
public void close( String reason );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a session attribute specific to this connection.
|
* Sets a session attribute specific to this connection. If the value
|
||||||
|
* is set to null then the attribute is removed.
|
||||||
*
|
*
|
||||||
* @return The previous session value for this key or null
|
* @return The previous session value for this key or null
|
||||||
* if there was no previous value.
|
* if there was no previous value.
|
||||||
|
@ -443,6 +443,8 @@ public class DefaultServer implements Server
|
|||||||
|
|
||||||
public Object setAttribute( String name, Object value )
|
public Object setAttribute( String name, Object value )
|
||||||
{
|
{
|
||||||
|
if( value == null )
|
||||||
|
return sessionData.remove(name);
|
||||||
return sessionData.put(name, value);
|
return sessionData.put(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user