Exception in foreach loop of adding struct to List
<p>Hi guys I have suc­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­h code:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        struct Proxy
        {
            public static List&lt;string&gt; proxyList;
            public static string type;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            openFileDialog1.Title = "Choose file with proxy";
            openFileDialog1.InitialDirectory = System.Environment.CurrentDirectory;
            openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
            if (checkBox1.Checked)
                Proxy.type = "socks5";
            else
                Proxy.type = "http";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                foreach (string prox in File.ReadAllLines(openFileDialog1.FileName))
                {
                    if (prox.Contains(":"))
                    {
                        string[] proxy = prox.Split(':');
                        Proxy.proxyList.Add(prox);
                    }
                }
                MessageBox.Show(Proxy.proxyList.Count.ToString());
            }
        }

    }
}
</code></pre>

<p>But when I load txt file:</p>

<pre><code>62.109.28.37:8085
193.0.147.23:8085
193.0.147.90:8085
193.0.147.61:8085
193.0.147.47:8085
193.0.147.93:8085
</code></pre>

<p>I receive an exception: on line <code>Proxy.proxyList.Add(prox);</code>
 Object reference not set to an instance of an object.</p>

<p>Why?=\</p>
