Catch invalid format exception for WoL port (host manual configuration)

This commit is contained in:
Synced Synapse 2015-04-13 23:06:28 +01:00
parent 59a42eb8bb
commit 6164dddbdd
1 changed files with 7 additions and 1 deletions

View File

@ -222,7 +222,13 @@ public class HostFragmentManualConfiguration extends Fragment {
String macAddress = xbmcMacAddressEditText.getText().toString();
aux = xbmcWolPortEditText.getText().toString();
int xbmcWolPort = TextUtils.isEmpty(aux) ? HostInfo.DEFAULT_WOL_PORT : Integer.valueOf(aux);
int xbmcWolPort = HostInfo.DEFAULT_WOL_PORT;
try {
xbmcWolPort = TextUtils.isEmpty(aux) ? HostInfo.DEFAULT_WOL_PORT : Integer.valueOf(aux);
} catch (NumberFormatException exc) {
// Ignoring this exception and keeping WoL port at the default value
}
// Check Xbmc name and address
if (TextUtils.isEmpty(xbmcName)) {