Check for defined ports before using the setting