Closure Input being called with null argument

I’m trying to provide a custom task called AppendTask which looks like this:

The problem I’m having is users of this task type have to ignore calls with a null argument because Gradle internally calls the task that way at some point. So if I create an AppendTask like this:
task(testAppend, Type: AppendTask) {
inputMaps << [file(“a.txt”), file(“b.txt”)]
filter {
if (line == null) { throw new Exception() }

I get a stacktrace like this:
at org.gradle.util.GUtil.uncheckedCall(
… 72 more

Gradle’s CopyTask doesn’t require a null check. What is this uncheckedCall business? What am I missing?

1 Like

I’ve got this issue today. Wonder no one else caught it.