`res` can be `nil` here.