This check looks useless indeed. But are we sure that this is a correct fix? May be here should be another check?