Whoever has doubt or uncertainty should seek what is correct, then perform two prostrations.
أخبرنا سويد بن نصر قال أنبأنا عبد الله عن مسعر عن الحكم عن أبي وائل
من شك أو أوهم فليتحر الصواب ثم ليسجد سجدتين
[Sahih, mawquf] See the previous hadith, and it is in Kubra, hadith no. 1169.