Description

Crash occurs when trying to edit a MetaSound Source asset while a MetaSound Source is referenced utilizing FObjectFinder in C++

Repro Rate: 3/3

Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\Templates\Casts.cpp] [Line: 10] 
Cast of nullptr to MetasoundEditorGraph failed
Steps to Reproduce
  1. Create a new Blank CPP project.
  2. Enable the MetaSound Plugin (Edit > Plugins) & restart the editor when prompted.
  3. Create a new Metasound Source named "MS_Test" in the Content directory
  4. Create a new CPP class based on Actor
  5. In 'MyActor.h' add this to the top of the file after #pragma once:
    • #include "Metasound.h"
      #include "MetasoundSource.h"
  6. In 'MyActor.cpp' add this inside of the Constructor for the class after the bCanEverTick gets set:
    • static ConstructorHelpers::FObjectFinder<UMetaSoundSource> MS_Bling(TEXT("MetaSoundSource'/Game/MS_Test.MS_Test'"));
  7. Open up {project-name}.Build.cs file located in {projectdir}/Source/{project-name}
  8. Replace the entire PublicDependencyModuleNames line with:
    • PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "MetasoundEngine" });
  9. Compile & Run the editor
  10. Double-Click to open up the MS_Test MetaSound Source in Content

Results: Editor crashes due to a casting error when opening the MetaSound Source editor.
Expected: User is able to reference the MetaSound Source asset created in the editor utilizing FObjectFinder and is able to edit the MetaSound Source.

Callstack
=== Critical error: ===

Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\Templates\Casts.cpp] [Line: 10] 
Cast of nullptr to MetasoundEditorGraph failed




[Callstack] 0x00007ffbd95296d5 UnrealEditor-CoreUObject.dll!CastLogError() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\Templates\Casts.cpp:11]
[Callstack] 0x00007ffbab50564d UnrealEditor-MetasoundEditor.dll!CastChecked<UMetasoundEditorGraph,UEdGraph>() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Public\Templates\Casts.h:324]
[Callstack] 0x00007ffbab602142 UnrealEditor-MetasoundEditor.dll!Metasound::Editor::FGraphBuilder::SynchronizeGraphMembers() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\Metasound\Source\MetasoundEditor\Private\MetasoundEditorGraphBuilder.cpp:2166]
[Callstack] 0x00007ffbab60203a UnrealEditor-MetasoundEditor.dll!Metasound::Editor::FGraphBuilder::SynchronizeGraph() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\Metasound\Source\MetasoundEditor\Private\MetasoundEditorGraphBuilder.cpp:1738]
[Callstack] 0x00007ffbab5d6a8d UnrealEditor-MetasoundEditor.dll!Metasound::Editor::FEditor::InitMetasoundEditor() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\Metasound\Source\MetasoundEditor\Private\MetasoundEditor.cpp:751]
[Callstack] 0x00007ffbab5e66a9 UnrealEditor-MetasoundEditor.dll!Metasound::Editor::FAssetTypeActions_MetaSoundSource::OpenAssetEditor() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\Metasound\Source\MetasoundEditor\Private\MetasoundAssetTypeActions.cpp:166]
[Callstack] 0x00007ffbd1cfb433 UnrealEditor-UnrealEd.dll!UAssetEditorSubsystem::OpenEditorForAsset() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\Subsystems\AssetEditorSubsystem.cpp:377]
[Callstack] 0x00007ffbd1cfbca9 UnrealEditor-UnrealEd.dll!UAssetEditorSubsystem::OpenEditorForAssets_Advanced() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\Subsystems\AssetEditorSubsystem.cpp:451]
[Callstack] 0x00007ffbd1cfba3a UnrealEditor-UnrealEd.dll!UAssetEditorSubsystem::OpenEditorForAssets() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\Subsystems\AssetEditorSubsystem.cpp:567]
[Callstack] 0x00007ffbabf40805 UnrealEditor-ContentBrowserAssetDataSource.dll!ContentBrowserAssetData::EditOrPreviewAssetFileItems() [D:\build\++UE5\Sync\Engine\Plugins\Editor\ContentBrowser\ContentBrowserAssetDataSource\Source\ContentBrowserAssetDataSource\Private\ContentBrowserAssetDataCore.cpp:270]
[Callstack] 0x00007ffbabf40a60 UnrealEditor-ContentBrowserAssetDataSource.dll!ContentBrowserAssetData::EditOrPreviewItems() [D:\build\++UE5\Sync\Engine\Plugins\Editor\ContentBrowser\ContentBrowserAssetDataSource\Source\ContentBrowserAssetDataSource\Private\ContentBrowserAssetDataCore.cpp:290]
[Callstack] 0x00007ffbabf29aff UnrealEditor-ContentBrowserAssetDataSource.dll!UContentBrowserAssetDataSource::BulkEditItems() [D:\build\++UE5\Sync\Engine\Plugins\Editor\ContentBrowser\ContentBrowserAssetDataSource\Source\ContentBrowserAssetDataSource\Private\ContentBrowserAssetDataSource.cpp:1228]
[Callstack] 0x00007ffbc34b20f0 UnrealEditor-ContentBrowser.dll!SContentBrowser::OnItemsActivated() [D:\build\++UE5\Sync\Engine\Source\Editor\ContentBrowser\Private\SContentBrowser.cpp:2680]
[Callstack] 0x00007ffbc346b010 UnrealEditor-ContentBrowser.dll!TBaseSPMethodDelegateInstance<0,SContentBrowser,1,void __cdecl(TArrayView<FContentBrowserItem const ,int>,enum EAssetTypeActivationMethod::Type),FDefaultDelegateUserPolicy>::Execute() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:290]
[Callstack] 0x00007ffbc34b44db UnrealEditor-ContentBrowser.dll!SAssetView::OnListMouseButtonDoubleClick() [D:\build\++UE5\Sync\Engine\Source\Editor\ContentBrowser\Private\SAssetView.cpp:3658]
[Callstack] 0x00007ffbc3472c36 UnrealEditor-ContentBrowser.dll!TBaseSPMethodDelegateInstance<0,SAssetView,1,void __cdecl(TSharedPtr<FAssetViewItem,1>),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:307]
[Callstack] 0x00007ffbc33f8802 UnrealEditor-ContentBrowser.dll!TDelegate<void __cdecl(TSharedPtr<FAssetViewItem,1>),FDefaultDelegateUserPolicy>::ExecuteIfBound<void,0>() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:607]
[Callstack] 0x00007ffbc34c767d UnrealEditor-ContentBrowser.dll!SListView<TSharedPtr<FAssetViewItem,1> >::Private_OnItemDoubleClicked() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Public\Widgets\Views\SListView.h:1087]
[Callstack] 0x00007ffbc34b48a2 UnrealEditor-ContentBrowser.dll!STableRow<TSharedPtr<FAssetViewItem,1> >::OnMouseButtonDoubleClick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Public\Widgets\Views\STableRow.h:398]
[Callstack] 0x00007ffbd8d6601e UnrealEditor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FBubblePolicy,FPointerEvent,<lambda_be18c20258355610e1a03a230227eebb> >() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:405]
[Callstack] 0x00007ffbd8dde866 UnrealEditor-Slate.dll!FSlateApplication::RoutePointerDoubleClickEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5420]
[Callstack] 0x00007ffbd8dc8249 UnrealEditor-Slate.dll!FSlateApplication::ProcessMouseButtonDoubleClickEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5405]
[Callstack] 0x00007ffbd8dbcea1 UnrealEditor-Slate.dll!FSlateApplication::OnMouseDoubleClick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5368]
[Callstack] 0x00007ffc16b7a8f5 UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2214]
[Callstack] 0x00007ffc16b69247 UnrealEditor-ApplicationCore.dll!FWindowsApplication::DeferMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2699]
[Callstack] 0x00007ffc16b7ce51 UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:1078]
[Callstack] 0x00007ffc16b649a7 UnrealEditor-ApplicationCore.dll!FWindowsApplication::AppWndProc() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:916]
[Callstack] 0x00007ffc545363ed USER32.dll!UnknownFunction []
[Callstack] 0x00007ffc545360be USER32.dll!UnknownFunction []
[Callstack] 0x00007ffba7ff6552 InkObj.dll!UnknownFunction []
[Callstack] 0x00007ffc47931028 atlthunk.dll!UnknownFunction []
[Callstack] 0x00007ffc545363ed USER32.dll!UnknownFunction []
[Callstack] 0x00007ffc54535de2 USER32.dll!UnknownFunction []
[Callstack] 0x00007ffc16b7e148 UnrealEditor-ApplicationCore.dll!FWindowsPlatformApplicationMisc::PumpMessages() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsPlatformApplicationMisc.cpp:138]
[Callstack] 0x00007ff7d8ba7114 UnrealEditor.exe!FEngineLoop::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5139]
[Callstack] 0x00007ff7d8bc0d9c UnrealEditor.exe!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:183]
[Callstack] 0x00007ff7d8bc0e8a UnrealEditor.exe!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:147]
[Callstack] 0x00007ff7d8bc3c4d UnrealEditor.exe!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:283]
[Callstack] 0x00007ff7d8bd5534 UnrealEditor.exe!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:330]
[Callstack] 0x00007ff7d8bd86e6 UnrealEditor.exe!__scrt_common_main_seh() [d:\a01\_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
[Callstack] 0x00007ffc536d7bd4 KERNEL32.DLL!UnknownFunction []
[Callstack] 0x00007ffc5504ced1 ntdll.dll!UnknownFunction []

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-149182 in the post.

1
Login to Vote

Fixed
ComponentUE - Audio - MetaSounds
Affects Versions5.0
Target Fix5.0.2
Fix Commit19867459
Release Commit19867459
CreatedApr 14, 2022
ResolvedApr 22, 2022
UpdatedJan 25, 2023
View Jira Issue