Check for undefined or null on contentDocument

Need to check for both `undefined` and `null`, not just `null`.