Getting checked does not stop castling. Only if the king has already moved, is already in check, or has to walk through a check can it not castle.
Rules for castling

it doesnt matter if the castle is under attack? does it?
if the rook is under attack you may be better off NOT castling...

Once some guy I was playing thought that when you castled the king went on the square you're castle was on, and the castle went on the square your king was on example.
How he thought you castled, LOL
Well, I'm sure neither one of us chess lovers learnt all the rules when we first started playing. In my case, it was years before I even heard of en passant...
So, I wouldn't laugh at your friend...
I think I may have been under a misconception about castling. I thought one of the prohibitions was that a king must not previously have been in check. It seems that the rule is not presently in check. Have I been misguided all this time?