Check for stings existance before escaping

If you do not specify one or more of the strings of an Attachment, it will fail to send the message because escaping the strings will fail. Let's check for the existance of said strings before we do escape them and thus avoid these problems.
I tested this on my local copy from npm and it works perfectly.