If you learn to "run off" the board, you'll never get hurt. The reason people get hurt while longboarding (electric or not) is not because of poor balance or environmental hazards, but their inexperience with simply continuing to run in the direction they are traveling if the board comes out from under their feet. This is by no means an affront to those who have been injured longboarding, as I myself have been situationally unaware and injured myself.
You can practice running off the board by riding into a garden hose (this will also prevent damage to the board or trucks). You can make the hose more or less taut to make the stopping intensity higher or lower. What you are trying to do is maintain your momentum in the direction you are traveling, and your goal is to make this such a natural reaction that your body will automatically do it when something unexpected knocks the board out from under your feet.