Fix undefined error when dports are not set