The defendant shall be excused for failure to comply with a command in the writ to produce the person detained, and the hearing may proceed without such production, if (a) the applicant, in writing, has waived such production, or (b) the court shall be satisfied that the person detained cannot be brought into court without danger to himself because of sickness or infirmity.
N.J.S. § 2A:67-21