Cognitive radios allow secondary users to use the underutilized spectrum. However, in the presence of a primary user, the unlicensed users must vacate the spectrum, leading to a decrease in network performance or even network partition. In this paper we address the problem of robust topology control in wireless sensor networks with the objective of assigning a sensor channel on each radio such that the resulting topology is robust to the presence of a primary user. That means that if a channel is reclaimed by a primary user, the resulting secondary user topology still preserves the connectivity between any two nodes. In this paper we propose a distributed algorithm for channel assignment which has low overhead and is scalable with the number of sensor nodes. We analyze the performance of our algorithm using ns-3 simulations.