My boyfriend is going to jail?

My boyfriend got into a little trouble with the law before we met and we’ve been together officially maybe 6 months. I love him to death. He’s been going to court trying to deal with the repercussions of his actions and he may be facing jail time. I mean I obviously want to stay with him even though it will be tough and I know everyone will probably think I’m stupid for that. I’m just having trouble trying to cope with the fact that he won’t be here some nights. The consequences haven’t been decided for him so he might not have jail time at all but it’s just this constant anxiety that him and I deal with. I don’t feel comfortable talking to anyone that I know about this because they all have very hurtful words to say about it. I’m open to any advice or anything. I just don’t know how to cope with it and needed somewhere to vent. And no he didn’t harm anyone or anyone’s property, I don’t see him as a criminal. But the law does.

Edit:

He was speeding and freaked out when the cop got behind him and kept going. No drugs in his system or in the car, no alcohol at all, just pure stupidity in the moment. Jail time is not 100% it’s still being discussed but his lawyer mentioned that there’s a good chance he might and not for a long time maybe a weekend or two.