Catch and ignore exception when masking invalid detector. Re #6160.