Skip to content

Commit 182437a

Browse files
iTris666GitHub Enterprise
authored andcommitted
Some extra security around error feedback (#153)
* Prevent exceptions from making notification stay. Prevent exception in errors to potential break the ui * Prevent list from being badly deserialized.
1 parent b8212d0 commit 182437a

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewController.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,14 @@ public void NotifyUpdate()
205205
while (m_CurrentActions.Count > 0)
206206
{
207207
var action = m_CurrentActions[m_CurrentActions.Count - 1];
208-
action();
208+
try
209+
{
210+
action();
211+
}
212+
catch(Exception e)
213+
{
214+
Debug.LogException(e);
215+
}
209216
cpt++;
210217
m_CurrentActions.RemoveAt(m_CurrentActions.Count - 1);
211218
}

com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,10 @@ DropdownMenuAction.Status ShaderValidationStatus(DropdownMenuAction action)
580580
return DropdownMenuAction.Status.Normal;
581581
}
582582

583+
[NonSerialized]
583584
Dictionary<VFXModel, List<IconBadge>> m_InvalidateBadges = new Dictionary<VFXModel, List<IconBadge>>();
585+
586+
[NonSerialized]
584587
List<IconBadge> m_CompileBadges = new List<IconBadge>();
585588

586589
private void RegisterError(VFXModel model, VFXErrorOrigin errorOrigin,string error,VFXErrorType type, string description)

com.unity.visualeffectgraph/Editor/Models/VFXModel.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,14 @@ public void RefreshErrors(VFXGraph graph)
133133
graph.errorManager.ClearAllErrors(this, VFXErrorOrigin.Invalidate);
134134
using (var reporter = new VFXInvalidateErrorReporter(graph.errorManager, this))
135135
{
136-
GenerateErrors(reporter);
136+
try
137+
{
138+
GenerateErrors(reporter);
139+
}
140+
catch(Exception e)
141+
{
142+
Debug.LogException(e);
143+
}
137144
}
138145
}
139146
}

0 commit comments

Comments
 (0)