Check key via ContainsKey instead of null check