The legislation which deals with this is the Criminal Code Act 1913 at Section 23B. It provides as follows:
(1) This section is subject to the provisions in Chapter XXVII and section 444A relating to negligent acts and omissions.
(2) A person is not criminally responsible for an event which occurs by accident.
(3) If death or grievous bodily harm —
(a) is directly caused to a victim by another person’s act that involves a deliberate use of force; but
(b) would not have occurred but for an abnormality, defect or weakness in the victim,
the other person is not, for that reason alone, excused from criminal responsibility for the death or grievous bodily harm.
(4) Subsection (3) applies —
(a) even if the other person did not intend or foresee the death or grievous bodily harm; and
(b) even if the death or grievous bodily harm was not reasonably foreseeable.