It is a defence for a person charged with an offence under section 39(1) in relation to any activity to prove that—
for the purposes of Part 10 of Schedule 3A to the Communications Act 2003 (the electronic communications code) (undertaker's works), the person is the operator or a relevant undertaker, and
the activity was carried out for the purpose of executing emergency works, within the meaning of that code.
…