Throwing an early exception if the type is empty