Sex on period

Is it bad to have sex while being on your period?
Or is it bad to get your period while having sex??