Check for undefined or null on contentDocument

Set default parameter on contentDocument