What if the fish somehow touch the walls or bottom of the aquarium?
It's not a problem. The current travels through the water, not the tank. Glass does not conduct electricity which is why the tank isn't grounded all of the time. Also, it's a matter of making a bridge from the water to outside structures. Sometimes just wearing certain shoes will prevent you from being electrically connected to the floor!