Even comedian Robin Williams isn’t immune from getting stopped by cops when he’s riding a bike on a New York sidewalk.

And it was no laughing matter.

During his appearance on the ABC estrogen-filled gabfest “The View” this morning, Williams told a story about how he recently became one of many cyclists stopped by police for riding on the sidewalk.

SUBDUED ROBIN WILLIAMS IN ‘TIGER’ OF FLAWED STRIPE

ROBIN WILLIAMS’ NEW NY PAD

“I got hit by a bike on a sidewalk!” co-host Elisabeth Hasselbeck said.

“Well, it’s the law because of her,” Williams barked back.

“[I was dressed] like a terrorist or a crack dealer, your call. No one was on the sidewalk, and all of a sudden woop-woop,” Williams added.

At first, Williams said the cops didn’t recognize him — but once they did, he was promptly let go with a warning.