Derek Chauvin's current trial seems to be one of the most followed and most emotionally significant trials. Feelings and opinions are strong on both sides. Many consider it an open-and-shut case (some celebrities even state that he should be convicted without a trial), yet on deeper examination it's not all that easy for the prosecution. It's the prosecution which has to prove guilt beyond reasonable doubt, and several of the defense's arguments (for example, Floyd repeatedly saying he can't breathe even while he was still in the car) might become a tough nut to crack. This means the trial can still have surprises, and strong emotions could be stirred up in certain groups if the results fall far from their expectations. For example, many people strongly believe that if Chauvin is found not guilty, or if his sentence is not harsh enough, then significant riots will ensue.
I presented the above example as a context to my question: by deciding on a verdict, a jury should concentrate on what really happened, and not on what feelings they think might be evoked by the public upon hearing their decision. Yet jurors are all human, and might consciously or unconsciously still take such things into account. Consider the hypothetical case the jury thinks that guilt cannot be proven beyond reasonable doubt, but they declare guilty anyway, for fearing a potential riot. They might rationalize that by sentencing a person they believe to be innocent, they save potentially hundreds or thousands from grievous harm.
How is such a dilemma handled by the courts?
Please note that this question is not about your opinion about what the verdict should be in the mentioned example. It's about the possibility when the judge or jury sincerely believe a defendant to be innocent but declare guilty (or sincerely believe a defendant to be guilty but declare innocent) solely because they personally believe that the correct verdict would lead to a violent riot where many innocents could die. Are such possibilities handled in any way, are there countermeasures against it, is there precedent for a case which was later overturned due to allegations of the verdict having been made for the above mentioned reasons?