Most people give too much code, but this is one of those rare examples when someone has not given enough.

We need to know the context of the if statement from your first code example. Is it in a...