Handle if types are undefined or null