A helper function that does a quick check on a value to determine if it is null or not. If it is null, it returns the `$then` argument. If it is not null, then it returns the value that was being checked.