The text from : islampfr.com
The sixth reason to get acquaintance of the Imam of each era:
"Salvation from the being misled in the Occultation"
Imam Sadiq (PBUH) has said:
“Get to know the Imam of your era, if you know him, whether the Reappearance occurs quickly or late, you won’t incur any losses.”
Al-Qaibat Na´mani, Chapter 25.
Imam Sadiq (PBUH) said:
“If you experience the Occultation, persist on reciting this prayer: O! God, introduce your Imam to me, otherwise I will go astray from my religion.”
Kamal al-Din and Tamam Al-Nimeh, Chapter 33
A reminder: we should not forget that Shimr also saw the Imam of his era but did not recognize him.