We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 447cd5e commit ca014e1Copy full SHA for ca014e1
1 file changed
scripts/python/app/NUT-Monitor-py2gtk2.in
@@ -400,7 +400,13 @@ class interface :
400
def __check_gui_fields( self, widget=None ) :
401
host = self.__widgets["ups_host_entry"].get_text()
402
try:
403
- port = int( self.__widgets["ups_port_entry"].get_value() )
+ # Note: get_value() might not reflect currently typed text until focused out or Enter pressed.
404
+ # get_text() + conversion is safer for real-time typing response.
405
+ port_text = self.__widgets["ups_port_entry"].get_text()
406
+ if not port_text:
407
+ port = 3493
408
+ else:
409
+ port = int(float(port_text))
410
except:
411
port = 3493
412
0 commit comments