Allow server without port

This commit is contained in:
angelblue05 2017-11-02 22:34:10 -05:00
parent 8041273c05
commit 17211df01e

View file

@ -79,10 +79,10 @@ class ServerManual(xbmcgui.WindowXMLDialog):
server = self.host_field.getText() server = self.host_field.getText()
port = self.port_field.getText() port = self.port_field.getText()
if not server or not port: if not server:
# Display error # Display error
self._error(ERROR['Empty'], lang(30617)) self._error(ERROR['Empty'], lang(30617))
log.error("Server or port cannot be null") log.error("Server cannot be null")
elif self._connect_to_server(server, port): elif self._connect_to_server(server, port):
self.close() self.close()
@ -117,7 +117,7 @@ class ServerManual(xbmcgui.WindowXMLDialog):
def _connect_to_server(self, server, port): def _connect_to_server(self, server, port):
server_address = "%s:%s" % (server, port) server_address = "%s:%s" % (server, port) if port else server
self._message("%s %s..." % (lang(30610), server_address)) self._message("%s %s..." % (lang(30610), server_address))
result = self.connect_manager.connectToAddress(server_address) result = self.connect_manager.connectToAddress(server_address)