Fix NPE when url for delete game has changed

I think it's only an issue for debug builds where I've manually pointed
at a different server, but just in case.
This commit is contained in:
Eric House 2019-02-11 07:32:17 -08:00
parent 58882fe52f
commit ceb68b9787
2 changed files with 9 additions and 2 deletions

View file

@ -251,7 +251,7 @@ public class NetUtils {
params.put( k_PARAMS, param ); params.put( k_PARAMS, param );
String paramsString = getPostDataString( params ); String paramsString = getPostDataString( params );
if ( null != paramsString ) { if ( null != conn && null != paramsString ) {
try { try {
conn.setReadTimeout( 15000 ); conn.setReadTimeout( 15000 );
conn.setConnectTimeout( 15000 ); conn.setConnectTimeout( 15000 );
@ -294,6 +294,9 @@ public class NetUtils {
} catch( java.io.IOException ioe ) { } catch( java.io.IOException ioe ) {
Log.ex( TAG, ioe ); Log.ex( TAG, ioe );
} }
} else {
Log.e( TAG, "not running conn %s with params %s", conn,
paramsString );
} }
return result; return result;

View file

@ -126,7 +126,11 @@ public class XWPrefs {
public static String getDefaultRelayUrl( Context context ) public static String getDefaultRelayUrl( Context context )
{ {
return getPrefsString( context, R.string.key_relay_url ); String result = getPrefsString( context, R.string.key_relay_url );
if ( result == null || 0 == result.length() ) {
result = context.getString( R.string.default_relay_url );
}
return result;
} }
public static boolean getSkipToWebAPI( Context context ) public static boolean getSkipToWebAPI( Context context )