A post-processing device adapted to perform post-processing on a recording medium (T) 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 (T); a punching unit configured to create a hole in the recording medium (T); a stapling unit located downstream of the punching unit in a transporting direction of the recording medium (T); a first sensor for detecting the recording medium (T) 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 (T); a second sensor for detecting the recording medium (T) 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 (T) and upstream of the stapling unit in the transporting direction of the recording medium (T); 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 (T) is supplied to the punching unit and, if passage of the recording medium (T) through an arrangement position of the second sensor is detected within a predetermined first time period after detection of passage of the recording medium (T) through an arrangement position of the first sensor , the recording medium (T) is allowed to be supplied to the stapling unit . a post-processing recording-medium transporting unit configured to feed a recording medium (T); a punching unit configured to create a hole in the recording medium (T); a stapling unit located downstream of the punching unit in a transporting direction of the recording medium (T); a first sensor for detecting the recording medium (T) 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 (T); a second sensor for detecting the recording medium (T) 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 (T) and upstream of the stapling unit in the transporting direction of the recording medium (T); 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 (T) is supplied to the punching unit and, if passage of the recording medium (T) through an arrangement position of the second sensor is detected within a predetermined first time period after detection of passage of the recording medium (T) through an arrangement position of the first sensor , the recording medium (T) is allowed to be supplied to the stapling unit . <EOS>