RealDocs

UAssetManager::WarnAboutInvalidPrimaryAsset

function Engine Since unknown
#include "Engine/AssetManager.h"
Access: public Specifiers: virtualconst

Description

Logs a warning that a primary asset id is missing or invalid, but only once per id for the session.

Caveats & Gotchas

  • Deduplicates per PrimaryAssetId for the process lifetime, so the same invalid reference only logs once even if requested repeatedly.
  • Only logs a warning and does not assert or throw — callers must still handle the invalid id themselves, e.g. by skipping the load.

Signature

virtual void WarnAboutInvalidPrimaryAsset(const FPrimaryAssetId& PrimaryAssetId, const FString& Message) const

Parameters

Name Type Description Default
PrimaryAssetId const FPrimaryAssetId& The invalid or missing primary asset id being warned about.
Message const FString& Extra context to include in the warning, such as the caller.

Return Type

void

Example

Warn once when an id fails to resolve C++
if (!AssetId.IsValid())
{
	UAssetManager::Get().WarnAboutInvalidPrimaryAsset(AssetId, TEXT("Requested by UMyInventoryComponent::GiveItem"));
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.