In 1722 Afghan rebels overthrew Sultan Husayn and installed Mahmud Hotaki as shah who was murdered in 1725 and succeeded by his cousin, Ashraf. By 1729, Hosayn's son, Tahmasebi II, had control of most of the country, as well as support from Russia, the Ottoman Empire and tentatively, the Mughal Empire.
Unfortunately in 1732 he was deposed by Nadir Khan (the future Nadir Shah) in favor of his 7yo son, who succeeded as Abbas III (under the regency of Nadir Khan) and ruled until 1736 when Nadir seized power for himself. Both Tahmasebi and all his sons (Abbas included) were murdered on the orders of Nadir Shah's son Reza Qoli Mirza in 1739/1740 prompted by advice given Mohammed Hasan Khan Qajar that if the rumors that Nadir was dead, the people would rise in revolt and restore Tahmasebi to the throne.
But what if Nadir had never deposed Tahmasebi? What if the Safavids continued to rule Persia? Would it still have become the military monster it did under Nadir - destroying the Mughal Empire in the process? Or would the two nations have been in a more amicable relationship with each other?