In the only change from the Bayern side that beat title rival Borussia Dortmund 1-0 on Wednesday (AEST), Hernandez replaced Jerome Boateng in the centre of defence.
It was the France international's second start in all competitions this year, having spent three months out with an ankle ligament injury he suffered in October.
Hernandez, who was an €80 million ($133.5 million) signing from Atletico Madrid ahead of the 2019-2020 season, was replaced by Michael Cuisance at half-time on Sunday (AEST) as Bayern held a 3-0 lead, with Joshua Kimmich moving to centre-back.
Flick revealed the decision was a precautionary measure.
"He had an adductor problem. Considering the score, the risk was too high, we didn't want to take it," Flick said.
An eighth straight Bundesliga title now looks a certainty for Bayern, while it is also in the DFB-Pokal semi-finals and has a 3-0 lead in its UEFA Champions League Round of 16 tie with Chelsea, and Flick praised the mentality of his players.
It took the lead via an own goal from Mathias Jorgensen and extended their advantage through Benjamin Pavard and Robert Lewandowski.
Lewandowski scored his second four minutes into the second half and Alphonso Davies rounded off the scoring in a comprehensive triumph soon after.
"We want to have a successful season but there is still a lot left to play," Flick said.
"It was important to me that we didn't let up after the Dortmund game. I am very, very satisfied, we were very aggressive.
"We push each other in the team because the emotions don't come from the stands, you hear that a little more on the pitch."