[
https://issues.apache.org/jira/browse/TREQ-10?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13139679#comment-13139679
]
Mck SembWever commented on TREQ-10:
-----------------------------------
this patch breaks SessionScopeExtractorTest.testGetKeysNoSession(..)
but i agree that returning null should always be avoided. especially when an
empty collection is an alternative.
> NPE while reading the session scope when no session has been created
> --------------------------------------------------------------------
>
> Key: TREQ-10
> URL: https://issues.apache.org/jira/browse/TREQ-10
> Project: Tiles Request
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Nicolas Le Bas
> Priority: Minor
>
> If no HttpSession has been created, the following code leads to an exception:
> Map<String, Object> scopes = new HashMap<String, Object>();
> Map<String, Object> data = request.getContext("session");
> scopes.putAll(data);
> java.lang.NullPointerException
>
> org.apache.tiles.request.util.RequestUtil.enumerationSize(RequestUtil.java:64)
>
> org.apache.tiles.request.collection.ReadOnlyEnumerationMap.size(ReadOnlyEnumerationMap.java:128)
> java.util.HashMap.putAll(HashMap.java:498)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira