Skip to content

Conversation

@gp-lnuff
Copy link
Contributor

@gp-lnuff gp-lnuff commented Sep 3, 2025

Hello,

the $append/$prepend properties are already nullable, however when you set them to null through the setter methods it triggers the InvalidArgumentException.
I would not consider this expected behaviour, especially when passing a Closure (which is allowed) that conditionally appends or prepends an item based on a condition, like user permissions.
By adding a single clause that does nothing if null is passed in (or if $prepend/$append evaluate to null), expected behaviour is restored.
Let me know if there is a reason it should behave like this, thank you.

requested
@CodeWithDennis CodeWithDennis merged commit c1b22a6 into CodeWithDennis:4.x Sep 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants