I tried checking for null but the compiler warns that this condition will never occur. What should I be looking for?
You should probably use:
if(myDictionary.ContainsKey(someInt)) { // do something }
The reason why you can't check for null is that the key here is a value type.