You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{% if(model.Friends.size == nil or model.Friends.size <= 0) and (model.PendingFriends == nil or model.PendingFriends.size <= 0) %}
<div>
<h2class="text-muted">#No Friends</h2>
<pclass="text-muted">You have no friends on this platform yet. Don't worry, I'm sure you'll make some!</p>
</div>
{% endif %}
And this was ALWAYS showing the result, because PendingFriends was always an empty array, even though Friends wasn't empty.
Checking for either case individually worked as expected, but putting together a couple of grouped ORs with an AND via parenthesis did not work as expected.
PHP: 8.x
Liquid: 1.4.42
OS: Linux -> LAMP stack
If I'm just missing something, let me know, but removing the nil checks makes it work as expected (just less safe).
The text was updated successfully, but these errors were encountered:
I had the following if statement:
And this was ALWAYS showing the result, because PendingFriends was always an empty array, even though Friends wasn't empty.
Checking for either case individually worked as expected, but putting together a couple of grouped ORs with an AND via parenthesis did not work as expected.
PHP: 8.x
Liquid: 1.4.42
OS: Linux -> LAMP stack
If I'm just missing something, let me know, but removing the
nil
checks makes it work as expected (just less safe).The text was updated successfully, but these errors were encountered: