Using OpenFilePanel at runtime to open a file as a TextAsset to read data is giving NullReferenceException

I am trying to open a csv file using the OpenFile Dialog window which I will convert to a TextAsset and then Split accordingly to read the data, but it keeps giving me a NullReferenceException.

NullReferenceException: Object reference not set to an instance of an object
CsvNameSpace.CsvReader+<SetAngles>d__34.MoveNext () (at Assets/CsvReader.cs:92)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
CsvNameSpace.CsvReader:Update() (at Assets/CsvReader.cs:80)

Here is my code:

using System.Collections;
using System.IO;
using System.Text;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

namespace CsvNameSpace {

    public class CsvReader : MonoBehaviour

        public string[] fieldsNext;
        public string[] fields;
        public TextAsset csvFile;
        public Button record;
        public GameObject rWrist;
        public GameObject rPalm;
        public GameObject indexMeta;
        public GameObject thumbMeta;
        public GameObject middleMeta;
        public GameObject ringMeta;
        public GameObject pinkyMeta;
        public GameObject index_1;
        public GameObject index_2;
        public GameObject index_3;
        public GameObject indexEnd;
        public GameObject thumb_1;
        public GameObject thumb_2;
        public GameObject thumbEnd;
        public GameObject middle_1;
        public GameObject middle_2;
        public GameObject middle_3;
        public GameObject middleEnd;
        public GameObject ring_1;
        public GameObject ring_2;
        public GameObject ring_3;
        public GameObject ringEnd;
        public GameObject pinky_1;
        public GameObject pinky_2;
        public GameObject pinky_3;
        public GameObject pinkyEnd;

        // Update is called once per frame
        int i = 0;
        long previoustime = 0;

        void Start()
            //open file dialog
            var path = EditorUtility.OpenFilePanel("", "","CSV");
            if (path == "")
                //if no file is chosen then change back to recording scene
                StreamReader file = new StreamReader(path);
                //load file as a TextAsset
                csvFile = Resources.Load(path) as TextAsset;

        void Update()

        IEnumerator SetAngles()
            print("Time " + Time.time);
            if (i > 0)
                //put CSV file into array called records by obtaining each row
                string[] records = csvFile.text.Split('

//ERROR OCCURS HERE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

did you get any answers coz i am facing the same thing and if you can help me out it will be grateful.