I'm a foreigner living in Barcelona for four years, only once has someone tried to pickpocket me and I noticed them easily. I agree with your sentiment though, Barcelona feels like an incredibly safe city (at least in the center/Eixample) and I've never felt worried at night. Having lived/visited in Leeds/London and NYC in my experiences they are vastly more worrying/dangerous at night.