Currently in Sema::getDestructorName we call SS.getScopeRep()->getPrefix() but SS.getScopeRep() can return nullptr because LookupInNestedNameSpec(...) called a little before can invalidate SS.
This fixes: https://github.com/llvm/llvm-project/issues/59446
CXXScopeSpec::isSet() is apparently (intended to be) deprecated.
It sounds like this should instead call .isValid() or .isNotEmpty(), but I'm not sure which.