This avoids the corner case where `via` is not nil, but has a length of 0, so the updated code does not panic in that situation. Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>