Hi Shrey,
There are some verbs of emotions when the indirect object cannot be replaced by the usual pronouns, verbs like 'songer à quelqu'un' , 'avoir recours à quelqu'un' , 'faire attention à quelqu'un', ...which come under the same rule as 'penser à quelqu'un' if there is one...
You could at a pinch replace by the pronoun 'y' but it is normally for things rather than people.
e.g.
J'ai beaucoup songé à elle ces derniers jours = I thought about her these last few days
Nous avons du avoir recours à eux = We have had to rely on them
Fais attention à elle! = Beware of her!
Hope this helps