Null check in AssignHitLayer