On the hearing of an application for a restraining order, a witness is not required to answer a question or to produce a document if the court is satisfied that the answering of the question or the production of the document may prejudice the investigation of, or the prosecution of a person for, an offence.