BROOKLYN–(AP June 20)–Former Nebraska forward Isaiah Roby was selected in the second round of Thursday’s NBA draft at the Barclays Center in Brooklyn.

Roby was the 45th overall pick and initially was drafted by the Detroit Pistons, but quickly traded to the Dallas Mavericks, who initially selected Deividas Sirvydis of Lithuania with their scheduled 37th pick, but agreed to trade his rights to Pistons for Roby and two future second-round picks, according to a person with knowledge of the deal.

Roby, who averaged 12 points and seven rebounds for the Huskers last season, will join a young Mavericks team led by 20-year-old Doncic, likely to win the NBA’s Rookie of the Year, and 23-year-old Kristaps Porzingis, acquired during the season from the Knicks and coming off a knee injury.

Dallas finished 33-49 last year and hasn’t made the playoffs since 2015-16.