You used a “Type hint” on your “Data” input: Line.
Try to add a “A = Data;” in your script, you’ll find that your originally “null” object is converted to a 0-length line with start and end points to 0,0,0 … so it is never “null”.
Rhino.Geometry.Line is a non-nullable type, so from inside your c# viewpoint “Data” is always ok.
You can input your lines as GeometryBase (which is nullable, it seems…) and lately cast them as LineCurve type when you need it. line.gh (10.2 KB)