Master bating while postpartum?

I know it’s not safe to have sex before 6 weeks after having a baby because you can get an infection but what about masterbation?