Macro causes Editor to crash

I have a macro that is meant to run on sublevels (that is, levels being streamed into a persistent world). It strangely generally works as it should in Play-In-Editor testing. However, if a change is made on a blueprint that is being referenced in this macro (in this case, BP_Box), the editor will crash with this error:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000018

UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

Or may return an error like this:

Blueprint Runtime Error: "Attempted to access missing property 'None_861982911'. If this is a packaged/cooked build, are you attempting to use an editor-only property?". Blueprint: L1a Function: Execute Ubergraph L1a Graph: CollectLevelData Node: Set Integer (by ref)

I’m not sure if what I’m doing is causing this, or if this is an unavoidable bug that I have to find a workaround for.


Moving the classes referenced in “Get All Actors of Class” creates a myriad of new issues:

[0146.13] Compile of PersistentLevel.L1a failed. 14 Fatal Issue(s) 0 Warning(s) [in 82 ms] (/Game/Levels/L1a.L1a:PersistentLevel.L1a)

Invalid pin connection from  Array generated from expanding Collect Level Data  and  Out Actors generated from expanding Collect Level Data : Array of BP Diamond Object References is not compatible with Array of Actor Object References. (You may have changed the type after the connections were made)

Invalid pin connection from  Array generated from expanding Collect Level Data  and  Out Actors generated from expanding Collect Level Data : Array of BP Box Object References is not compatible with Array of Actor Object References. (You may have changed the type after the connections were made)

Invalid pin connection from  Array generated from expanding Collect Level Data  and  Out Actors generated from expanding Collect Level Data : Array of BP Diamond Object References is not compatible with Array of Actor Object References. (You may have changed the type after the connections were made)

Invalid pin connection from  Array generated from expanding Collect Level Data  and  Out Actors generated from expanding Collect Level Data : Array of BP Box Object References is not compatible with Array of Actor Object References. (You may have changed the type after the connections were made)

COMPILER ERROR: failed building connection with 'Array of BP Box Object References is not compatible with Array of Actor Object References.' at  Get (a copy) generated from expanding Collect Level Data

COMPILER ERROR: failed building connection with 'Array of BP Diamond Object References is not compatible with Array of Actor Object References.' at  Get (a copy) generated from expanding Collect Level Data

Can't connect pins  Target Array generated from expanding Collect Level Data  and  Out Actors generated from expanding Collect Level Data : Array of BP Box Object References is not compatible with Array of Actor Object References.

Can't connect pins  Out Actors generated from expanding Collect Level Data  and  Target Array generated from expanding Collect Level Data : Array of Actor Object References is not compatible with Array of BP Diamond Object References.

Invalid pin connection from ' Out Actors generated from expanding Collect Level Data ' to ' Target Array generated from expanding Collect Level Data '. You may have changed the type after the connections were made.

Can't connect pins  Out Actors generated from expanding Collect Level Data  and  Target Array generated from expanding Collect Level Data : Array of Actor Object References is not compatible with Array of BP Box Object References.

Invalid pin connection from ' Out Actors generated from expanding Collect Level Data ' to ' Target Array generated from expanding Collect Level Data '. You may have changed the type after the connections were made.

Can't connect pins  Target Array generated from expanding Collect Level Data  and  Out Actors generated from expanding Collect Level Data : Array of BP Diamond Object References is not compatible with Array of Actor Object References.

The current value of the ' Array generated from expanding Get (a copy) ' pin is invalid: Array inputs (like 'Target Array') must have an input wired into them (try connecting a MakeArray node).

The current value of the ' Array generated from expanding Get (a copy) ' pin is invalid: Array inputs (like 'Target Array') must have an input wired into them (try connecting a MakeArray node).

Additionally, this error appears when the For Each Loops and classes are deleted and recreated to remove errors.

Blueprint Runtime Error: "Accessed None trying to read property CallFunc_Array_Get_Item_2". Blueprint:  L1a Function:  Execute Ubergraph L1a Graph:  CollectLevelData Node:  Set Integer (by ref)

Check references to BP Box. It seems you have an incompatible for loop iterating over an array of it.

Check if Collect Level Data compiles correctly it seems to also throw errors. (Perhaps you are calling it too fast and game instance is invalid)

Adding a delay node can temporarily fix the issue for some reason. However, once another
change is made to BP_Box, the macro might work fine, but usually after two or three Plays it will begin to throw errors before crashing again.

Does CollectLevelData use any nodes that are editor only?