Re: strange.....but serious question
I recommend you DO NOT try to masturbate with the catheter in. It will be extremely uncomfortable, possibly even painful, and the semen will clog up the catheter. It is vital that the catheter not be clogged, because then urine will not be able to pass through to the bag. If that happens, you will have to get it taken out and a new one inserted - that will seriously NOT be something you want to have happen.
I've had this indwelling catheter experience a number of times, and I always do my best NOT to think about sex for the time it is in. THAT is the best approach, believe me.