When the striker went to have a second go, more objects were thrown, including a glass Buckfast bottle which went just past his shoulder.
As Griffiths picked up the bottle, Hernandez ran over and showed his a booking, despite protests both from Griffiths and team mate Mikael Lustig.
When Griffiths was substituted, Jonny Hayes took over corner kick duties, and he too was targeted by missiles when he went to take them.
It was however Griffiths' corners which proved fatal to Linfield, with both Celtic goals, from Scott Sinclair and Tom Rogic inside the opening 22 minutes, giving the Scottish champions a 2-0 win.
Celtic manager Brendan Rodgers said he had feared for Griffiths' safety, following a game where the club had refused their official ticket allocation.
He said: 'I didn't quite see what it actually was but if that is the case then of course there is always a worry, but I didn't see or haven't heard anything as of yet as to what was thrown on, I could only see it from the dug-out.
"It was maybe a bottle of some sort, but anything, whether it's a coin or a bottle or whatever, shouldn't happen. Players go on to the field and it should be a safe environment for them.
"You want the passion from the stands to stay in there, but if you take that away from it, it was a good evening. You sometimes get these scenes throughout the country, not just here but other places as well.
"Obviously it's not what you wanted to see. The game was played in good spirit, in the main. So it's not ideally what you would like to see. I thought it was strange him getting booked for it.
"The talk is more really on the football for us. The scoreline was okay, it could have been better but it gives us the advantage for the second leg."
Linfield manager David Healy tried to play down the incident and said he wanted to concentrate on his team's performance.
He said: "I think a lot of people in the media were making a big deal out of it. Linfield as a club have made giant strides over the years to try to cut that shouting and abuse out but you get that in Old Firm games, you get that in Manchester derbies, you are always going to get a ferocious red-hot atmosphere.
"Our fans back us - back the players and me - through thick and thin and hopefully they'll continue to do that throughout the season."
The thrown bottle was one of a number of disturbances during a game which had been moved to Friday in order to avoid a clash with Orange Order marches earlier in the week.
The Scotland international got a further measure of revenge, with the game ending with riot police in front of one section of the stadium after the home support reacted furiously to Griffiths tying a Celtic scarf onto a goalpost.
It was an eventful night for Griffiths, who also put the ball in the net but saw the effort ruled offside.
Celtic's win puts them in pole position to reach the next round of qualifying, where the winners of this tie will play either Dundalk or Rosenborg.