The simplest way to reproduce:
open your webgui
go to System->General
Under 'WebGUI', change the protocol to HTTPS
Don't enter a new port, leave default
You will get an error about "port 0".
Put a port number in the new port field (say 443) and save.
However the UI implies that there are at least two defaults already..
ie:"Enter a custom port number for the WebGUI above if you want to override the default (80 for HTTP, 443 for HTTPS)."
This should obviously self-populate if possible.