diff --git a/FRBDK/Glue/GameCommunicationPlugin/GlueControl/Managers/VariableSendingManager.cs b/FRBDK/Glue/GameCommunicationPlugin/GlueControl/Managers/VariableSendingManager.cs index e090b33cc..f2feced78 100644 --- a/FRBDK/Glue/GameCommunicationPlugin/GlueControl/Managers/VariableSendingManager.cs +++ b/FRBDK/Glue/GameCommunicationPlugin/GlueControl/Managers/VariableSendingManager.cs @@ -652,8 +652,14 @@ private NamedObjectSave GetCombinedNos(NamedObjectSave nos, string glueScreenNam return clone; } - private string ToGameType(GlueElement element) => - GlueState.Self.ProjectNamespace + "." + element.Name.Replace("\\", "."); + private string ToGameType(GlueElement element) + { + + var projectNamespace = GlueState.Self.ProjectNamespace; + + return projectNamespace + "." + element.Name.Replace("\\", "."); + + } private async Task TryPushVariable(GlueVariableSetData data) { @@ -675,6 +681,10 @@ private async Task TryPushVariable(GlueVariableSetD private GlueVariableSetData GetGlueVariableSetDataDto(string variableOwningNosName, string rawMemberName, string type, string value, GlueElement currentElement, AssignOrRecordOnly assignOrRecordOnly, bool isState) { + if(currentElement == null) + { + throw new ArgumentNullException(nameof(currentElement)); + } var data = new GlueVariableSetData(); data.InstanceOwnerGameType = ToGameType(currentElement); data.Type = type;