How to connect to a dedicated server with OnlinesubsystemNULL from a client with OnlinesubsystemSteam

Main problem is here:

 void AGameModeBase::PreLogin(const FString& Options, const FString& Address, const FUniqueNetIdRepl& 
 UniqueId, FString& ErrorMessage)
 { 
      // Login unique id must match server expected unique id type OR No unique id could mean game doesn't use them
  const bool bUniqueIdCheckOk = (!UniqueId.IsValid() || (UniqueId.GetType() == UOnlineEngineInterface::Get()->GetDefaultOnlineSubsystemName()));

 if (bUniqueIdCheckOk)
 {
      ErrorMessage = GameSession->ApproveLogin(Options);
 }
 else
 {
      ErrorMessage = TEXT("incompatible_unique_net_id");
 }

… we can solve it using the following solution:

PendingNetGame.cpp

 // Connection->PlayerId = LocalPlayer->GetPreferredUniqueNetId();

But it is not good to change the source files of the engine. Is there another solution?

Previous versions of the engine crashed on line 952 in the OnlineSubsystemTypes.h, it was enough to comment out the following code:

 // check(GetType() == TYPE);

managed to fix it ?