The pilots can have any guests they want in the cockpit as long as they deem it safe. There is a jumpseat there, which is used often, and they know their job. I have seen this happen on other airlines too.
Had you told me that there was loud music and you could smell pot coming from the cockpit, I would have started wondering, but here it seems quite safe.