Merge "Add nullability check to fix crash" into main