Guard against JSON parse errors