check for null to fix NPE.

This commit is contained in:
Andy2 2011-04-25 21:08:51 -07:00
parent 7a5920e9f2
commit 33c81ec7ec

View file

@ -173,20 +173,22 @@ public class DictLangCache {
getInfo( context, name );
}
s_handler.post( new Runnable() {
public void run() {
if ( null != m_dictsAdapter ) {
rebuildAdapter( m_dictsAdapter,
DictLangCache.
getHaveLang( context,
m_adaptedLang ) );
if ( null != s_handler ) {
s_handler.post( new Runnable() {
public void run() {
if ( null != m_dictsAdapter ) {
rebuildAdapter( m_dictsAdapter,
DictLangCache.
getHaveLang( context,
m_adaptedLang ) );
}
if ( null != m_langsAdapter ) {
rebuildAdapter( m_langsAdapter,
DictLangCache.listLangs( context ) );
}
}
if ( null != m_langsAdapter ) {
rebuildAdapter( m_langsAdapter,
DictLangCache.listLangs( context ) );
}
}
} );
} );
}
}
private static String[] listLangs( Context context )