Handling nullable foreign keys' lookups