mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
fix NPE (possible race condition)
This commit is contained in:
parent
ea4a2ea609
commit
ddb64d3dc9
1 changed files with 2 additions and 2 deletions
|
@ -201,14 +201,14 @@ public class ExpiringDelegate {
|
||||||
m_pct = (int)((100 * passed) / INTERVAL_SECS);
|
m_pct = (int)((100 * passed) / INTERVAL_SECS);
|
||||||
if ( m_pct > 100 ) {
|
if ( m_pct > 100 ) {
|
||||||
m_pct = 100;
|
m_pct = 100;
|
||||||
} else {
|
} else if ( null != m_handler ) {
|
||||||
long onePct = INTERVAL_SECS / 100;
|
long onePct = INTERVAL_SECS / 100;
|
||||||
long lastStart = m_startSecs + (onePct * m_pct);
|
long lastStart = m_startSecs + (onePct * m_pct);
|
||||||
Assert.assertTrue( lastStart <= now );
|
Assert.assertTrue( lastStart <= now );
|
||||||
long nextStartIn = lastStart + onePct - now;
|
long nextStartIn = lastStart + onePct - now;
|
||||||
// DbgUtils.logf( "pct change %d seconds from now", nextStartIn );
|
// DbgUtils.logf( "pct change %d seconds from now", nextStartIn );
|
||||||
|
|
||||||
m_handler.postDelayed( mkRunnable(), 1000 * nextStartIn );
|
m_handler.postDelayed( mkRunnable(), 1000 * nextStartIn ); // NPE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue