Search Issue Tracker

Fixed

Votes

0

Found in [Package]

1.5.1-pre.3

Issue ID

UVSB-1261

Regression

No

[Visual Scripting] GraphPointerException occurs when the assigned graph is deleted and graph property is clicked

Package: Visual Scripting

-

GraphPointerException occurs when assigned graph/state asset is deleted and graph property is clicked on State/Graph machine component

Steps to repro:
1. Create a new Project
2. Project window > Right-click > Create > Visual Scripting > Script
3. Hierarchy > right-click > create empty
4. Hierarchy > select GameObject > Add Component > Script Machine
5. Drag and drop and attach Script Graph to Script Machine
6. Delete Script graph asset from the project window
7. Hierarchy > select GameObject > Click on Missing Graph property on the inspector

Actual Result:
GraphPointerException appears on the console window

Expected Result:
No error appears in the console or a warning appears in the console telling the graph is missing

Reproducible on: 2021.2.0a4, 2021.1.0b5, 2021.1.0b1

Note: Visual Scripting was introduced in 2021.1.0b1

Package Version 1.5.1-pre.3

Environment:
Windows 10, Mac 10.15

Stack Trace:
GraphPointerException: Graph pointer is invalid.
[ GameObject ]
Unity.VisualScripting.GraphPointer.EnsureValid () (at Library/PackageCache/com.unity.visualscripting@1.5.1-pre.3/Runtime/VisualScripting.Core/Graphs/GraphPointer.cs:587)
Unity.VisualScripting.GraphWindow.set_reference (Unity.VisualScripting.GraphReference value) (at Library/PackageCache/com.unity.visualscripting@1.5.1-pre.3/Editor/VisualScripting.Core/Windows/GraphWindow.cs:77)
Unity.VisualScripting.GraphWindow.MatchSelection () (at Library/PackageCache/com.unity.visualscripting@1.5.1-pre.3/Editor/VisualScripting.Core/Windows/GraphWindow.cs:161)
Unity.VisualScripting.GraphWindow._OnProjectChange () (at Library/PackageCache/com.unity.visualscripting@1.5.1-pre.3/Editor/VisualScripting.Core/Windows/GraphWindow.cs:254)
Unity.VisualScripting.EditorApplicationUtility.OnProjectChange () (at Library/PackageCache/com.unity.visualscripting@1.5.1-pre.3/Editor/VisualScripting.Core/Utilities/EditorApplicationUtility.cs:144)
UnityEditor.EditorApplication.Internal_CallProjectHasChanged () (at <d7ddb8158a2944f3808fbb0703d4e132>:0)

  1. Resolution Note:

    Fixed GraphPointerException when looking at a deleted graph component

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.