FObjectAndNameAsStringProxyArchive operator << with bLoadIfFindFails wrong?

In FObjectAndNameAsStringProxyArchive::operator<< (in ArchiveUObject.cpp) an object is only loaded if Obj is valid and bLoadIfFindFails is true.

		if(Obj && bLoadIfFindFails)
		{
			Obj = LoadObject<UObject>(nullptr, *LoadedString);
		}

Shouldn’t this be checking if(!Obj && bLoadIfFindFails)?

As it is now, if FindObject returns null, it will not try to load it, and if Find returns something valid, it will try to LoadObject.

Hi Grogger,

Thanks for pointing this out. This has already been updated in 4.14. The code currently reads:

if ((Obj == nullptr) && bLoadIfFindFails)
{
	Obj = LoadObject<UObject>(nullptr, *LoadedString);
}