null safety on segment transformation