Don't access a value of undefined before the check