Generally, Section 36(4) CFRN 1999 requires that all criminal trials shall be done publicly. However, they are circumstances where the court can hear a criminal trial in private and these instances are as follows;

1. Where a statute expressly requires so.
2. On grounds of public policy, public decency or expediency.
3. Where the evidence of a person who has not attained the age of 17 years is to be beard in relation to offence against morality. Section 260 ACJA.
4. In the interest of public safety, defence, public order, or any other special reasons which will be contrary to the interest of justice.
5. Where the minister satisfies the court that it would not be in the interest of the public for any matter to be publicly disclosed in a trial.

The Constitution also has a proviso to section 36(4) CFRN 1999.
Thus, that a trial was not heard in the public doesn't invalidate it, unless it wasn't done under the exceptions allowed by the law.