clsss within class , null reference exception, C#
<p>My class looks like this.</p>

<pre><code>public class LogSettings
{
    public string attributeName { get; set; }//TODO: change the variable name

    public Warnings[] warnings = new Warnings[3];
}

public class Warnings
{
   public string typeOfWarning {get; set;}

    public bool isAbsolute { get; set; }

    public decimal numUpDownValue { get; set; }

    public LogSettingActions[] actionItems = new LogSettingActions[10];
}

public class LogSettingActions
{
    public string actionItem{ get; set;}
}
</code></pre>

<p>but when I try to create Warnings instance it throws NullReference error.</p>

<pre><code>var rows = FindChilds&lt;ctlLogConfigRow&gt;(lvLogConfigTemplate);
foreach (var row in rows)
{
    LogSettings instance = new LogSettings();
    instance.attributeName = row.GroupHeaderText;

    var allWarnings = FindChilds&lt;ctlWarnings&gt;(row);

    for (int i = 0; i &lt; allWarnings.Count; i++)
    {

       instance.warnings[i].typeOfWarning = allWarnings[i].ctlWarningGroupBoxFixedHeader1.Header.ToString();//It throws error here
</code></pre>

<p>Can anybody help me?</p>
