&& because they both need to be non-empty.
Ahh.. I misread what you'd done there (it's been an overly long day 🙂 ).
Somewhere in my head I'd seen that you'd only had a single ! and bracketed the two .empty tests (goodness knows how)
i.e. (!( myList.isEmpty() && myOtherList.isEmpty() )
which would have have required an ||.
This is the error I get trying that
try wrapping all your core code in this #if( ! $display.alt($myList,"").isEmpty() )
(replacing myList with your lists)
#if( ! $display.alt($myList,"").isEmpty() )
#foreach(myItem in myList)
#set($thing=myItem.thing)
#end
#end
(This code was provided by @SanfordWhiteman when I was getting a similar error).
So, assign your lists to local variables. However, before you do any iterations of them test for emptiness
Cheers
I'm curious. When I was having the same conundrum as @michaelstancil , you gave me a 'long form' version..
namely:
#if( ! $display.alt($myList,"").isEmpty() )
Since then you've gone with the simpler
#if( !$myList.isEmpty() )
For my continuing education and edification, why the change in recommendation (sorry if this seems like a **bleep** question, I'm just trying to get my Velocity as good as it possibly can be)?
Cheers
Sorry, missing a dollar sign up there. Edited.
@Jo_Pitts1 Thanks for that! Silly question but how do I input the no value check?
@SanfordWhiteman I updated based on the edit, and now I get:
Could it be where I'm placing the Token?
Sure you don’t have another {{my.token}} in the email that’s specifically pointing to the 0th element?