We have a saying in climbing regarding when to replace live-saving protective gear:

"When in doubt, throw it out"

If you suffered an impact on your head wearing the helmet, you don't know what the condition of the foam under your plastic outer area of the helmet looks like. It may not be cracked on the outside, but maybe there is a fracture on the inside that you can't see.