Ensure value isn't empty before trying to encode
Ref T46