It's probably best to keep your electric razor in your checked luggage, as there is little chance of it causing any issues. However, if you are traveling with just a carry-on, there is no issue bringing it with you.