A construction machine comprising; a first and a second variable displacement hydraulic pumps (1, 2) and a pilot pump; a left travel motor and a first working device that are operated by the first variable displacement hydraulic pump; a plurality of control valves (5, 6, 7) that are installed in a flow path of the first variable displacement hydraulic pump and control the hydraulic oil supplied to the left travel motor or the first working device; a right travel motor and a second working device that are operated by the second variable displacement hydraulic pump; a plurality of control valves (10, 11, 12) that are installed in a flow path of the second variable displacement hydraulic pump and control the hydraulic oil supplied to the right travel motor or the second working device; a straight travel valve that is switched by a pilot pressure induced from an electrical control valve, the straight travel valve, when being switched, supplying the hydraulic oil of one of the first and second variable displacement hydraulic pumps (1, 2) to the left and right travel motors (4, 9) while supplying the hydraulic oil of the other of the first and second variable displacement hydraulic pumps (1, 2) to the first and second working devices; and a pressure detection sensor (17, 18, 21, 22) for detecting a pilot pressure applied to the left and right travel motor control valves (5, 10) and the pilot pressure applied to the first and second working device control valves (6, 7, 11, 12); characterized in that the construction machine further comprises: a controller that outputs a control signal to the electrical control valve so that the pilot pressure applied to the straight travel valve is blocked in case that a pressure difference between the pilot pressures applied to the left and right travel motor control valves (5, 10) is larger than a pre-set pressure value, when the first and second working devices are operated during a travel. a first and a second variable displacement hydraulic pumps (1, 2) and a pilot pump; a left travel motor and a first working device that are operated by the first variable displacement hydraulic pump; a plurality of control valves (5, 6, 7) that are installed in a flow path of the first variable displacement hydraulic pump and control the hydraulic oil supplied to the left travel motor or the first working device; a right travel motor and a second working device that are operated by the second variable displacement hydraulic pump; a plurality of control valves (10, 11, 12) that are installed in a flow path of the second variable displacement hydraulic pump and control the hydraulic oil supplied to the right travel motor or the second working device; a straight travel valve that is switched by a pilot pressure induced from an electrical control valve, the straight travel valve, when being switched, supplying the hydraulic oil of one of the first and second variable displacement hydraulic pumps (1, 2) to the left and right travel motors (4, 9) while supplying the hydraulic oil of the other of the first and second variable displacement hydraulic pumps (1, 2) to the first and second working devices; and a pressure detection sensor (17, 18, 21, 22) for detecting a pilot pressure applied to the left and right travel motor control valves (5, 10) and the pilot pressure applied to the first and second working device control valves (6, 7, 11, 12);