Reapply patch to fix crash from net code.