Input failed to collect data

Hello, How we can set the condition if the input is empty

DA.SetData(0,Vector3d.XAxis);
else
DA.SetData(0,data * Vector3d.XAxis);

 protected override void SolveInstance(IGH_DataAccess DA)
        {

            double data = double.NaN;

            //if (!DA.GetData(0, ref data)) { data = 1;return; }

            DA.GetData(0, ref data);

            DA.SetData(0, data * Vector3d.XAxis); 
 
        }