To prevent the deterioration of the detection accuracy of an object which comes into contact with a slit nozzle. The substrate treating device is provided with detection sensors 450, 451, and 452 which detect the object which comes into contact with the slit nozzle. The laser light rays of the detection sensors 450, 451, and 452 are set so that the rays may be narrowed down at positions shifted in the Y-axis direction. In this way, the effective detecting ranges E1, E2, and E3 of the sensors 450, 451, and 452 inspect the scanning range E0 of the slit nozzle in a shared state. When the object is detected at one of the sensors 450, 451, and 452 on the basis of the detected results of the sensors 450, 451, and 452, the movement of the slit nozzle is stopped and a warning is displayed.