Changeset 5664


Ignore:
Timestamp:
2003-10-17T04:40:21+13:00 (21 years ago)
Author:
jmt12
Message:

Bug in Preferences caused NPE if no port number given.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java

    r5595 r5664  
    145145    Dictionary.registerText(proxy_port_label, "Preferences.Connection.Proxy_Port");
    146146    String port_value = Gatherer.config.getString("general.proxy_port", true);
    147     proxy_port_field = new JSpinner(new SpinnerNumberModel((new Integer(port_value)).intValue(), 0, 65535, 1));
     147    if(port_value.length() > 0) {
     148       proxy_port_field = new JSpinner(new SpinnerNumberModel((new Integer(port_value)).intValue(), 0, 65535, 1));
     149    }
     150    else {
     151       proxy_port_field = new JSpinner(new SpinnerNumberModel(0, 0, 65535, 1));
     152    }
    148153    proxy_port_field.setEnabled(currently_enabled);
    149154    Dictionary.registerTooltip(proxy_port_field, "Preferences.Connection.Proxy_Port_Tooltip");
Note: See TracChangeset for help on using the changeset viewer.