Tac.AddLifeSupport.EvaAddPartModule C# (CSharp) Method

EvaAddPartModule() private method

private EvaAddPartModule ( Part part ) : void
part Part
return void
        private void EvaAddPartModule(Part part)
        {
            try
            {
                ConfigNode node = new ConfigNode("MODULE");
                node.AddValue("name", "LifeSupportModule");

                part.AddModule(node);

                this.LogWarning("The expected exception did not happen when adding the Life Support part module to the EVA!");
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("Object reference not set"))
                {
                    this.Log("Adding life support to the EVA part succeeded as expected.");
                }
                else
                {
                    this.LogError("Unexpected error while adding the Life Support part module to the EVA: " + ex.Message + "\n" + ex.StackTrace);
                }
            }
        }