A panic on an empty pointer value
A custom type function registered for a pointer returns nil when the field is empty. The decoder passed that nil to reflect.Value.Set and panicked with "call of reflect.Value.Set on zero Value". An earlier fix for this bug had been reverted because it broke the populated pointer case.
nil leaves the field alone
setFieldByType checks whether the function returned nil before calling Set, and if so leaves the field at its zero value. Any other result is set as before, and a test covers both nil and a pointer to a populated struct.