bryanhitc / lcu-sharp

An API wrapper for the League of Legends client.
MIT License
44 stars 10 forks source link

WaitForProcessAsync needs to wait for processes[0].MainModule != null #23

Closed timhaines closed 2 years ago

timhaines commented 2 years ago

A few times I've seen an exception in WaitForProcessAsync on Process.MainModule.FileName, where this code is reached while MainModule is still null (it gets set milliseconds later).

Updating the if (processes.Length > 0) to if (processes.Length > 0 && processes[0].MainModule != null) should fix it.