Merge "Add missing null checks after allocations."