check last endpoint only if profile is in memory. postpone profile update when connected

This commit is contained in:
orignal
2025-01-21 15:03:25 -05:00
parent cba7e5350d
commit 2857a163e9
2 changed files with 14 additions and 5 deletions

View File

@@ -890,7 +890,7 @@ namespace transport
}
auto session = std::make_shared<SSU2Session> (*this, router, address);
if (!isValidEndpoint && router->GetProfile ()->HasLastEndpoint (address->IsV4 ()))
if (!isValidEndpoint && router->HasProfile () && router->GetProfile ()->HasLastEndpoint (address->IsV4 ()))
{
// router doesn't publish endpoint, but we connected before and hole punch might be alive
auto ep = router->GetProfile ()->GetLastEndpoint ();