Skip to content

Commit

Permalink
chore: safer closure call for nested settings
Browse files Browse the repository at this point in the history
  • Loading branch information
augi committed Aug 9, 2023
1 parent 8912074 commit c01c75c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ abstract class ComposeExtension extends ComposeSettings {
Closure closure = (Closure)args[0].clone()
closure.setResolveStrategy(Closure.DELEGATE_FIRST)
closure.setDelegate(s)
closure.call(s)
if (closure.getMaximumNumberOfParameters() == 0) {
closure.call()
} else {
closure.call(s)
}
s
} else {
getOrCreateNested(name)
Expand Down

0 comments on commit c01c75c

Please sign in to comment.