Nije li jednostavnije provjeriti postojanje EPC-koda i nakon toga odraditi ostalo?
bool sadrzi= indeks.Contains("E2005777770E009819104F4");
// ako ne sadrži dodaj indeks
// ako sadrži provjeri max rezultat
Ovdje si definirao string indeks in EPC_master_list, indeks ne može biti null
Provrti
            foreach (string indeks in EPC_master_list)
            {              
                Console.WriteLine(indeks.Value);
            Console.WriteLine(indeks.HasValue);
            if (string.IsNullOrEmpty(indeks) == true)
            {
               Console.WriteLine("Null or empty");
            }
            }
 
     
    
    



 And I looked, and behold a pale horse: and his name that sat on him was Death, and Hell followed with him...
 
                        And I looked, and behold a pale horse: and his name that sat on him was Death, and Hell followed with him...