Am I overthinking it or is he messing with me?

Is it ever ok for a married man to say to another girl “your boyfriend is lucky to have you”...?