mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-23 07:27:22 +01:00
fix NPE
There was a way to get to the sender before its handler had been initialized. That can only happen on UI thread, so just drop the send rather than figure out a better way (for now).
This commit is contained in:
parent
193383bfa6
commit
73b6d0519f
1 changed files with 28 additions and 26 deletions
|
@ -29,7 +29,6 @@ import android.net.NetworkInfo;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
|
||||||
|
|
||||||
import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType;
|
import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -235,6 +234,9 @@ public class NetStateCache {
|
||||||
// will only fire if we go that long without coming
|
// will only fire if we go that long without coming
|
||||||
// through here again.
|
// through here again.
|
||||||
|
|
||||||
|
if ( null == mHandler ) {
|
||||||
|
Log.e( TAG, "notifyStateChanged(): handler null so dropping" );
|
||||||
|
} else {
|
||||||
if ( null != mNotifyLater ) {
|
if ( null != mNotifyLater ) {
|
||||||
mHandler.removeCallbacks( mNotifyLater );
|
mHandler.removeCallbacks( mNotifyLater );
|
||||||
mNotifyLater = null;
|
mNotifyLater = null;
|
||||||
|
@ -266,6 +268,6 @@ public class NetStateCache {
|
||||||
mHandler.postDelayed( mNotifyLater, WAIT_STABLE_MILLIS );
|
mHandler.postDelayed( mNotifyLater, WAIT_STABLE_MILLIS );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // class PvtBroadcastReceiver
|
}
|
||||||
|
} // class PvtBroadcastReceiver
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue