A post-processing device adapted to perform post-processing on a recording medium supplied from a main body of an image forming apparatus with an operating unit, a storage unit, and a main control unit, the post-processing device comprising: a post-processing recording-medium transporting unit configured to feed a recording medium; a punching unit configured to create a hole in the recording medium; a stapling unit located downstream of the punching unit in a transporting direction of the recording medium; a first sensor for detecting the recording medium fed by the post-processing recording-medium transporting unit, the first sensor being located upstream of the punching unit in the transporting direction of the recording medium; a second sensor for detecting the recording medium fed by the post-processing recording-medium transporting unit, the second sensor being located downstream of the punching unit in the transporting direction of the recording medium and upstream of the stapling unit in the transporting direction of the recording medium; a determining unit configured to determine whether the punching unit fails; and a transport controller configured to control the post-processing recording-medium transporting unit such that, when the determining unit determines that the punching unit failed and when a button for conducting a passage check displayed by the main control unit on a touch panel of the operating unit is confirmed by a user, the recording medium is supplied to the punching unit and, if passage of the recording medium through an arrangement position of the second sensor is detected within a predetermined first time period after detection of passage of the recording medium through an arrangement position of the first sensor, the recording medium is allowed to be supplied to the stapling unit. a post-processing recording-medium transporting unit configured to feed a recording medium; a punching unit configured to create a hole in the recording medium; a stapling unit located downstream of the punching unit in a transporting direction of the recording medium; a first sensor for detecting the recording medium fed by the post-processing recording-medium transporting unit, the first sensor being located upstream of the punching unit in the transporting direction of the recording medium; a second sensor for detecting the recording medium fed by the post-processing recording-medium transporting unit, the second sensor being located downstream of the punching unit in the transporting direction of the recording medium and upstream of the stapling unit in the transporting direction of the recording medium; a determining unit configured to determine whether the punching unit fails; and a transport controller configured to control the post-processing recording-medium transporting unit such that, when the determining unit determines that the punching unit failed and when a button for conducting a passage check displayed by the main control unit on a touch panel of the operating unit is confirmed by a user, the recording medium is supplied to the punching unit and, if passage of the recording medium through an arrangement position of the second sensor is detected within a predetermined first time period after detection of passage of the recording medium through an arrangement position of the first sensor, the recording medium is allowed to be supplied to the stapling unit.