It probably doesn't affect whether we have a sense of humor or not. What it does affect is some combination of whether we understand other people's jokes, whether we respond to jokes in a way that other people would recognize as us thinking they were funny, whether we make the kind of jokes that other people would find funny, whether we laugh in response to things that we don't find funny (such as things we find scary, disgusting, awful, etc -- for many people laughing is a nervous response to those things, and in no way suggests finding them funny, but non-autistic people tend to suppress that response better if they're prone to it), and whether, when we do laugh at something funny, anyone else can tell what it is we're laughing at.
For instance, I have a friend who was on a large bus full of people going to a convention, and saw a road sign that said "COW" on it.
She said that immediately what flashed through her head was a picture of a cow that had "ROAD SIGN" painted on it.
So she started laughing really hard, and probably everyone else thought she was "laughing at nothing" or something. I know someone else autistic who was actually punished in a mental institution for laughing about the idea of putting a comma between people's first and last name the same way you put it between a city and a state or country. Apparently they thought that not only it wasn't funny, but that it wasn't "appropriate" for her to laugh over something like that. She lost some sort of "privileges" for it. (With the understanding that "privileges" means things that everyone else considers a human right, but in institutions they take them away from you and hand them back as "privileges".)
_________________
"In my world it's a place of patterns and feel. In my world it's a haven for what is real. It's my world, nobody can steal it, but people like me, we live in the shadows." -Donna Williams