[TIMOB-17182] Added checks around the targetSDK before trying to validate it.