Finally, a Yankee went into an MRI machine and didn’t come out with a serious injury.

Gleyber Torres has been one of the very few Yankees to avoid injury this season, and even after Friday’s ugly-looking spill in the outfield grass, that still seems to be the case.

The second baseman underwent an MRI exam on his right hamstring Saturday that came back negative, meaning this time, the Yankees seem to have avoided another serious injury to a vital part of their lineup.

“I feel good,’’ Torres said after the Yankees’ 7-2 win over Toronto on Saturday. “[Friday] night was a scary moment for me.”

Torres was held out of the lineup a day after suffering the injury when he lost his footing trying to make a throw following his sliding stop of a Vladimir Guerrero Jr. grounder in the top of the fourth inning.

He appeared to be in considerable pain as he remained on the ground for several moments. He was looked at by manager Aaron Boone and trainer Steve Donohue, but remained in the game until his final at-bat in the sixth.

Boone said Torres came to them and said he had “weakness” in his legs and was removed before the seventh.

“After the play, I felt good, but a couple of innings later, I felt weak,’’ Torres said Saturday.

He woke up Saturday feeling good and believes he could have played.

“I felt like he’d be OK,’’ Boone said after the game. “But the fact it was clean confirmed what we had hoped.’’

Even with the good injury news, Boone will likely treat Torres carefully over the final week of the regular season heading into the playoffs. The manager said Torres could sit Sunday in advance of Monday’s off day before the team plays in Tampa Bay on Tuesday.

“Certainly with him, we’ll try be a little more cautious [than usual],’’ Boone said.

In the meantime, Boone said he won’t change much with how he deals with resting players as the Yankees try to catch Houston for best overall record for home-field advantage in the postseason.

“I don’t know about this last week, I’m always trying to make sure guys stay healthy and to protect guys,’’ Boone said. “Any ailments we’re dealing with, taking care of that trumps everything. That’s something [where] I’m always trying to strike that balance. We’re obviously trying to win games, but health is really important.”

Tyler Wade, in Torres’ absence, reached base three times and scored a run in the victory.