handle nil result when processing errors