Fix null cargo type crash