Ruby is earlier than 2.0.0, nil doesn't have .to_h