Avoid calling JSON.parse on undefined.