Skip to content
Loading
  • Rafnas T P
    +1
    I think in res array doesnt have value please check wha value are you getting  in res by putting breakpoint
     
    if you want to externally ignore this error then you can use try catch on thes linse
     
    1. try  
    2. {  
    3.     last = res.LastOrDefault();//get the last string of res array  
    4.     string[] final = last.Split(new char[] { '(' }).ToArray();    
    5. }  
    6. catch{} 
     
    +1
  • +1
    If res is indeed null, I recommend the following over catching and ignoring any exceptions:
     
    1. last = res?.LastOrDefault();    
    2. string[] final = last == null ? new string[0] : last.Split(new char[] { '(' }).ToArray();   
     
    +1
  • +1
    The program runs fine.When i put into a scheduler then the error repeat.@
    pritaeas
    +1
  • +1
    Hard to say without the code. What line exactly fails? Show your updated code.
     
    What exactly are you running in a scheduler, and which scheduler are you using?
     
    Can you show a stack trace? 
    +1
  • 0
    Thanks for your valuable time.@
    pritaeas
    0