fix json protection to return null in case of a syntax error