Editor crashing when opening material on 4.16

One of my material functions crashes the engine when I open the editor for it. It works fine, I use it in other materials and renders OK, I just can’t edit it anymore.

Here is the content folder for reproducing the issue.

Call stack :

Fatal error: [File:D:\Build\++UE4+Release-4.16+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\Templates\Casts.cpp] [Line: 10] 
Cast of nullptr to MaterialGraphNode failed


UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:349]
UE4Editor_CoreUObject!CastLogError() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\templates\casts.cpp:11]
UE4Editor_UnrealEd!CastChecked<UMaterialGraphNode,UEdGraphNode>() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\public\templates\casts.h:211]
UE4Editor_UnrealEd!UMaterialGraph::LinkGraphNodesFromMaterial() [d:\build\++ue4+release-4.16+compile\sync\engine\source\editor\unrealed\private\materialgraph.cpp:174]
UE4Editor_MaterialEditor!FMaterialEditor::InitMaterialEditor() [d:\build\++ue4+release-4.16+compile\sync\engine\source\editor\materialeditor\private\materialeditor.cpp:559]
UE4Editor_MaterialEditor!FMaterialEditorModule::CreateMaterialEditor() [d:\build\++ue4+release-4.16+compile\sync\engine\source\editor\materialeditor\private\materialeditormodule.cpp:63]
UE4Editor_AssetTools!FAssetTypeActions_MaterialFunction::OpenAssetEditor() [d:\build\++ue4+release-4.16+compile\sync\engine\source\developer\assettools\private\assettypeactions\assettypeactions_materialfunction.cpp:40]
UE4Editor_UnrealEd!FAssetEditorManager::OpenEditorForAsset() [d:\build\++ue4+release-4.16+compile\sync\engine\source\editor\unrealed\private\toolkits\asseteditormanager.cpp:351]
UE4Editor_AssetTools!FAssetTypeActions_Base::AssetsActivated() [d:\build\++ue4+release-4.16+compile\sync\engine\source\developer\assettools\public\assettypeactions_base.h:50]
UE4Editor_ContentBrowser!SContentBrowser::OnAssetsActivated() [d:\build\++ue4+release-4.16+compile\sync\engine\source\editor\contentbrowser\private\scontentbrowser.cpp:1893]
UE4Editor_ContentBrowser!TBaseSPMethodDelegateInstance<0,SContentBrowser,0,TTypeWrapper<void> __cdecl(TArray<FAssetData,FDefaultAllocator> const & __ptr64,enum EAssetTypeActivationMethod::Type)>::Execute() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:327]
UE4Editor_ContentBrowser!TBaseSPMethodDelegateInstance<0,SContentBrowser,0,void __cdecl(TArray<FAssetData,FDefaultAllocator> const & __ptr64,enum EAssetTypeActivationMethod::Type)>::ExecuteIfSafe() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:434]
UE4Editor_ContentBrowser!TBaseDelegate<void,TArray<FAssetData,FDefaultAllocator> const & __ptr64,enum EAssetTypeActivationMethod::Type>::ExecuteIfBound() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:624]
UE4Editor_ContentBrowser!SAssetView::OnListMouseButtonDoubleClick() [d:\build\++ue4+release-4.16+compile\sync\engine\source\editor\contentbrowser\private\sassetview.cpp:3755]
UE4Editor_ContentBrowser!TBaseSPMethodDelegateInstance<0,SAssetView,0,TTypeWrapper<void> __cdecl(TSharedPtr<FAssetViewItem,0>)>::Execute() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:327]
UE4Editor_ContentBrowser!TBaseSPMethodDelegateInstance<0,SAssetView,0,void __cdecl(TSharedPtr<FAssetViewItem,0>)>::ExecuteIfSafe() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:434]
UE4Editor_ContentBrowser!TBaseDelegate<void,TSharedPtr<FAssetViewItem,0> >::ExecuteIfBound() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:624]
UE4Editor_ContentBrowser!SListView<TSharedPtr<FAssetViewItem,0> >::Private_OnItemDoubleClicked() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\slate\public\widgets\views\slistview.h:815]
UE4Editor_ContentBrowser!STableRow<TSharedPtr<FAssetViewItem,0> >::OnMouseButtonDoubleClick() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\slate\public\widgets\views\stablerow.h:290]
UE4Editor_Slate!<lambda_eeb33fd1b480e3cad58a1531d90d2e14>::operator()() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:5460]
UE4Editor_Slate!FEventRouter::Route<FReply,FEventRouter::FBubblePolicy,FPointerEvent,<lambda_eeb33fd1b480e3cad58a1531d90d2e14> >() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:239]
UE4Editor_Slate!FSlateApplication::RoutePointerDoubleClickEvent() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:5458]
UE4Editor_Slate!FSlateApplication::ProcessMouseButtonDoubleClickEvent() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:5441]
UE4Editor_Slate!FSlateApplication::OnMouseDoubleClick() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:5419]
UE4Editor_Core!FWindowsApplication::ProcessDeferredMessage() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\core\private\windows\windowsapplication.cpp:1708]
UE4Editor_Core!FWindowsApplication::DeferMessage() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\core\private\windows\windowsapplication.cpp:2127]
UE4Editor_Core!FWindowsApplication::ProcessMessage() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\core\private\windows\windowsapplication.cpp:867]
UE4Editor_Core!FWindowsApplication::AppWndProc() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\core\private\windows\windowsapplication.cpp:714]

This was supposed to be fixed in UE-35362.

This happens on the 4.16.0 release.

Hey Gwenn,

Thanks for your report. I have reproduced your issue and entered a ticket, which you can track using the link below:

Have a great day

Hey Gwenn,

Quick question: Would you happen to have a 4.15 version of the affected asset or be able to reproduce this in 4.15? We are looking to see if this is a regression, but are unable to test since the asset provided was from a later version.

Thanks

No, sorry, I don’t. That happened in a 4.16 test project.

No problem, thanks for the response.