how to handle await Task return null case in c#
I met one issue when handling await Task return null case.
In below code, if GetByName() method return null. Then in my invoke code GUI will get exception below. I think it is because the GetByName() return null and I invoke it use await.
May I know is there any better way to handle such case? My purpose is just do something when return is not null, and do other thing if return is null. Both make sense for the logic.