You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Jon Pulice (Jira)" <ji...@apache.org> on 2024/07/31 14:20:00 UTC
[jira] [Updated] (WW-5451) NullPointerException when value array contains a null in the first entry
[ https://issues.apache.org/jira/browse/WW-5451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jon Pulice updated WW-5451:
---------------------------
Summary: NullPointerException when <s:iterator> value array contains a null in the first entry (was: NullPointerException when <s:terator> value array contains a null in the first entry)
> NullPointerException when <s:iterator> value array contains a null in the first entry
> -------------------------------------------------------------------------------------
>
> Key: WW-5451
> URL: https://issues.apache.org/jira/browse/WW-5451
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 6.4.0
> Reporter: Jon Pulice
> Priority: Minor
>
> When the first entry in an array contains a null value, and that array is used as the source for an <s:iterator> tag, a NullPointerException is thrown. This exception did not occur in prior versions of Struts 6.x
> Exception:
>
> {code:java}
> ERROR org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler - Exception occurred during processing request: null
> java.lang.NullPointerException: null
> at org.apache.struts2.components.IteratorComponent.start(IteratorComponent.java:309) ~[struts2-core-6.4.0.jar:6.4.0]
> at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:51) ~[struts2-core-6.4.0.jar:6.4.0]
> ...{code}
>
>
> A trivial example would be this tag:
> {code:java}
> <s:iterator value="pages">
> ...
> </s:iterator>{code}
> and Action:
>
> {code:java}
> public class TestAction extends ActionSupport {
> private Object[] pages = null;
>
> public String prompt() throws Exception {
> pages = new Object[10];
> return SUCCESS;
> }
> }
> {code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)