Try using an exclamation mark after the null. It's called a forgiving operator. Plenty web pages that explain it. The keywords are "exclamation mark C# null" in the appropriate search engine.