  We investigate the pairing in iron pnictides in the coexistence phase, which
displays both superconducting and antiferromagnetic orders. By solving the
pairing problem on the Fermi surface reconstructed by long-range magnetic
order, we find that the pairing interaction necessarily becomes
angle-dependent, even if it was isotropic in the paramagnetic phase, which
results in an angular variation of the superconducting gap along the Fermi
surfaces. We find that the gap has no nodes for a small antiferromagnetic order
parameter M, but may develop accidental nodes for intermediate values of M,
when one pair of the reconstructed Fermi surface pockets disappear. For even
larger M, when the other pair of reconstructed Fermi pockets is gapped by
long-range magnetic order, superconductivity still exists, but the
quasiparticle spectrum becomes nodeless again. We also show that the
application of an external magnetic field facilitates the formation of nodes.
We argue that this mechanism for a nodeless-nodal-nodeless transition explains
recent thermal conductivity measurements of hole-doped Ba_{1-x}K_xFe_2As_2.
[J-Ph. Read et.al. arXiv:1105.2232].
