Protect against nil encode errors