Hmm, if every descendant of Sophia of Hanover were to die childless, I think we had better worry about Armageddon rather than royal succession, as even just Queen Victoria has thousands of living descendants, among them commoners in the U.S. and elsewhere.
As I read the Act of Settlement 1701, if there are no longer any descendants of Sophia of Hanover, then there would be no legitimate successor to the British Crown anymore. It would require a new Act of Parliament (as well as acts of the legislatures or parliaments of all the other realms that share a monarch with the United Kingdom) to define anew the line of succession - similar (but much more sweeping) to the Perth Agreement of 2011.
I suspect that the Parliaments in such a situation (assuming that Armageddon has been warded off) might decide to abolish the monarchy. But if we want to speculate on who might have a claim to the throne if it were retained, my guess would be a descendant of Sophia's siblings - and, in the spirit of the current rules of succession, tracing through the most senior person with descendants in each generation regardless of gender. If I have traced this out correctly, I believe that this would lead to whoever the most senior descendant of Henri, Count of Paris (1908-1999) at that time would be. And given that Henri was the Orleanist pretender to the throne of France, this might actually lead to a unification of the British and (at least one version of the) French crowns - a rather weird resolution to the Hundred Years' War.