Unplugging the ground is a good precaution.

I often think the fear of wrecked electronic stuff is a little inflated, but it's aleways good to be cautious.

FWIW... I've mig welded leaking exhaust pipes on running cars(while they were actually running) next to the o2 sensor without issue.