[
https://issues.apache.org/jira/browse/GROOVY-11858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18060442#comment-18060442
]
ASF GitHub Bot commented on GROOVY-11858:
-----------------------------------------
eric-milles merged PR #2379:
URL: https://github.com/apache/groovy/pull/2379
> Splitting string inside tap closure throws NullPointerException
> ---------------------------------------------------------------
>
> Key: GROOVY-11858
> URL: https://issues.apache.org/jira/browse/GROOVY-11858
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 5.0.4
> Reporter: Evan Shaw
> Assignee: Eric Milles
> Priority: Major
>
> This code throws an exception:
> {code:groovy}
> 'a b c'.tap { println(split()) }
> {code}
> The exception message:
> {code}
> NullPointerException: Cannot invoke
> "groovy.lang.Closure.getMaximumNumberOfParameters()" because "wrapped" is null
> {code}
> If I pass an argument to split, it works as expected:
> {code:groovy}
> 'a b c'.tap { println(split(' ')) }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)