An electric-vehicle controller comprising: an inverter that is connected to a DC power source and drives a motor; a DC-to-DC converter one terminal pair of which is connected to the DC power source side of the inverter; and a power storage unit that is connected to the other terminal pair of the DC-to-DC converter and stores electric power, wherein there are provided a switch disposed between the power storage unit and the DC-to-DC converter and a control unit that opens the switch so as to separate the power storage unit from the DC-to-DC converter and stops the operation of the DC-to-DC converter, characterised in that: in the case where an emergency brake status signal for an electric vehicle is inputted to the control unit and the emergency brake status signal for the electric vehicle is generated, in the case where an auxiliary brake status signal or a direct backup brake status signal for an electric vehicle is inputted to the control unit and the auxiliary brake status signal or the direct backup brake status signal for the electric vehicle is generated, in the case where a pantograph lowering signal for an electric vehicle is inputted to the control unit and the pantograph lowering signal for the electric vehicle is generated, or in the case where a direction switch neutral position signal for the electric vehicle is inputted to the control unit and the direction switch neutral position signal for the electric-vehicle is generated, and, the control unit determines that external force or impact has been exerted or may be exerted on a main body of the electric vehicle, the electric-vehicle controller further including a vehicle speed detector for detecting a speed of an electric vehicle, wherein the speed detected by the vehicle speed detector is inputted to the control unit, and the fact that the speed is the same as or higher than a predetermined value is a prerequisite condition for the control unit to determine that external force or impact has been exerted or may be exerted on the main body. an inverter that is connected to a DC power source and drives a motor; a DC-to-DC converter one terminal pair of which is connected to the DC power source side of the inverter; and a power storage unit that is connected to the other terminal pair of the DC-to-DC converter and stores electric power, wherein there are provided a switch disposed between the power storage unit and the DC-to-DC converter and a control unit that opens the switch so as to separate the power storage unit from the DC-to-DC converter and stops the operation of the DC-to-DC converter, characterised in that: in the case where an emergency brake status signal for an electric vehicle is inputted to the control unit and the emergency brake status signal for the electric vehicle is generated, in the case where an auxiliary brake status signal or a direct backup brake status signal for an electric vehicle is inputted to the control unit and the auxiliary brake status signal or the direct backup brake status signal for the electric vehicle is generated, in the case where a pantograph lowering signal for an electric vehicle is inputted to the control unit and the pantograph lowering signal for the electric vehicle is generated, or in the case where a direction switch neutral position signal for the electric vehicle is inputted to the control unit and the direction switch neutral position signal for the electric-vehicle is generated, in the case where an emergency brake status signal for an electric vehicle is inputted to the control unit and the emergency brake status signal for the electric vehicle is generated, in the case where an auxiliary brake status signal or a direct backup brake status signal for an electric vehicle is inputted to the control unit and the auxiliary brake status signal or the direct backup brake status signal for the electric vehicle is generated, in the case where a pantograph lowering signal for an electric vehicle is inputted to the control unit and the pantograph lowering signal for the electric vehicle is generated, or in the case where a direction switch neutral position signal for the electric vehicle is inputted to the control unit and the direction switch neutral position signal for the electric-vehicle is generated, and, the control unit determines that external force or impact has been exerted or may be exerted on a main body of the electric vehicle, the electric-vehicle controller further including a vehicle speed detector for detecting a speed of an electric vehicle, wherein the speed detected by the vehicle speed detector is inputted to the control unit, and the fact that the speed is the same as or higher than a predetermined value is a prerequisite condition for the control unit to determine that external force or impact has been exerted or may be exerted on the main body.