How can I check to see if a connected port has a null input and then post a warning?
I know I can call InPorts[0].IsConnected but I want to handle the case when the port is connected but the input is null
public override IEnumerable<AssociativeNode> BuildOutputAst(List<AssociativeNode> inputAstNodes)
{
var node0 = inputAstNodes[0];
var port0 = InPorts[0];
I can’t find a property or method on either node0 or port0 that gets the value of the input
Thanks
If (input == None)
{
LogWarningMessageEvents.OnLogWarningMessage(“The input is null and cannot be processed. Check for null in the provided data”);
return new List();
}
Thank you @jacob.small, but where does input get its data? My point is that I want to add a check inside BuildOutputAst to see if the user is inputting “null” to a specific input node.
I was mistakenly thinking that I needed to post the warning in BuildOutputAst in the NodeModel.
Instead the value can be checked and the error posted in the NodeFunctions code.