Shader Graph Null Reference Exeption when copying properties to subgraph

When I click this:

I get this Error:

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ShaderGraph.Drawing.MaterialGraphEditWindow.ToSubGraph () (at ./Library/PackageCache/com.unity.shadergraph@14.0.9/Editor/Drawing/MaterialGraphEditWindow.cs:991)
UnityEditor.ShaderGraph.Drawing.MaterialGraphView.ConvertToSubgraph (UnityEngine.UIElements.DropdownMenuAction action) (at ./Library/PackageCache/com.unity.shadergraph@14.0.9/Editor/Drawing/Views/MaterialGraphView.cs:918)
UnityEngine.UIElements.DropdownMenuAction.Execute () (at <f6650f702d1247c2a5311a89b759ba03>:0)
UnityEditor.UIElements.EditorMenuExtensions+<>c__DisplayClass0_0.<PrepareMenu>b__0 () (at <78fe3e0b66cf40fc8dbec96aa3584483>:0)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at <78fe3e0b66cf40fc8dbec96aa3584483>:0)

Editor Version 2022.3.16f1 (latest 2022 LTS) (now updated to 2022.3.27f1, as corrected by @DevDunk )

I do not understand what is going on here, I think this is a bug.
I can still create a subgraph, create the code inside it… but it is very inconvenient to do when there is a tool that should work, but does not.

Thanks in advance

That definitely is not the latest LTS. That would be 2022.3.27. Give it a shot
if that does not work, file a bug report and link this thread in it

1 Like

Sorry, I thought Unity tells you when there’s an update. I’ll update now

yep, the issue is still there after updating. I’ll try a brand new project and see if it works differently from my converted one, if not then I’ll file a bug report

1 Like

brand new project does not work, filing bug

sorry for this question, but how do I share the Bug Report on this thread?

In Unity click Help - Report a bug

You can just type the bug report ID number here if anyone wants to reference it or when unity staff reads it

Thanks, bug ID IN-75743

Are there any updates? I can’t find the issue in issue tracker by ID

Unity says it’s fixed now

In there words:
All fixes for this bug report have been resolved and closed.

Summary:

Branch:2022.3.X
Resolution: Won’t Fix
Resolution Notes: This issue doesn’t exist in this version.

Branch:6000.0.X
Resolution: Fixed
Fix Versions: 6000.0.5f1
Resolution Notes:

Branch:2021.3.X
Resolution: Won’t Fix
Resolution Notes: This issue doesn’t exist in this version.

I would beg to differ…

That’s not the newest version, I don’t think

Yeah true, just observing that the ‘2022.3.x not having the issue’ is not correct. I’ll try updating to the newest, but if their resolution was ‘won’t fix’, I doubt it will have magically dissappeared…

Yeah - Resolution Notes: This issue doesn’t exist in this version. Is not correct, unless it was fixed as I uploaded the bug report

Same here, version 2022.3.46f1, which is not the lastest but almost and there is nothing in the .47 and .48 saying that they fixed this.

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ShaderGraph.Drawing.MaterialGraphEditWindow.ToSubGraph () (at ./Library/PackageCache/com.unity.shadergraph@14.0.11/Editor/Drawing/MaterialGraphEditWindow.cs:991)
UnityEditor.ShaderGraph.Drawing.MaterialGraphView.ConvertToSubgraph (UnityEngine.UIElements.DropdownMenuAction action) (at ./Library/PackageCache/com.unity.shadergraph@14.0.11/Editor/Drawing/Views/MaterialGraphView.cs:921)
UnityEngine.UIElements.DropdownMenuAction.Execute () (at <fda408e6cc0c473988f9e54a7f02de0d>:0)
UnityEditor.UIElements.EditorMenuExtensions+<>c__DisplayClass0_0.<PrepareMenu>b__0 () (at <e0a2c8363ef54a6393fed120beebdb7a>:0)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at <e0a2c8363ef54a6393fed120beebdb7a>:0)

Any workaround?

EDIT: The same error happens when copying properties from one (sub)graph to another, which is probably the source of the original problem.

Humm, that’s probably the issue then. Maybe file a bug report?