Thanks for your help and patience.
I didn’t have the latest version from the github which contains the new code for the function. After I downloaded it I can report that the
print_if_not_empty function is now working as intended.
I now just have a few tweaks to do in my template and I will be able to switch to the master_2020 version on my production machine.