Prevent null exception for weird case where setContentType() is invoked
with null argument.