Undefined/Null check before calling .replace() on a cdata wrapping

If you don't check and someone passes in an undefined variable it throws an error.  I added a simple check for this, if its undefined it returns an empty CDATA block.