Skip to content

Commit 3bd24e7

Browse files
committedJun 12, 2022
fix: NPE when GLE starts.
1 parent b37e078 commit 3bd24e7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎Runtime/Gamelogic/VisualScriptingGamelogicEngine.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,15 @@ public void OnBeforeSerialize()
198198
{
199199
#if UNITY_EDITOR
200200

201+
TableVariableDefinitions ??= new List<TableVariableDefinition>();
202+
PlayerVariableDefinitions ??= new List<PlayerVariableDefinition>();
203+
EventDefinitions ??= new List<EventDefinition>();
204+
Displays ??= Array.Empty<DisplayDefinition>();
205+
Switches ??= Array.Empty<VisualScriptingSwitch>();
206+
Coils ??= Array.Empty<VisualScriptingCoil>();
207+
Lamps ??= Array.Empty<VisualScriptingLamp>();
208+
Wires ??= Array.Empty<GamelogicEngineWire>();
209+
201210
var ids = new HashSet<string>();
202211
foreach (var def in PlayerVariableDefinitions) {
203212
if (!def.HasId || ids.Contains(def.Id)) {

0 commit comments

Comments
 (0)