There are protections, but as always legality can be questioned. In this case, I think he got fucked:
Eventually, the Department of Defence claimed public interest immunity over key information. This allows the government to withhold evidence (such as classified material) from the court on public interest grounds.
It means neither party can rely on the information.
This strategic decision meant McBride faced difficulties establishing key aspects of his whistleblower case. This included whether the information revealed relevant wrongdoing, his attempts to tell the department or police about his concerns, or whether the extent of the disclosure was necessary to establish wrongdoing.
There are protections, but as always legality can be questioned. In this case, I think he got fucked:
https://theconversation.com/david-mcbride-is-facing-jailtime-for-helping-reveal-alleged-war-crimes-will-it-end-whistleblowing-in-australia-218108