fix crash attempting to download dict when there's no network, e.g. in

airplane mode.
This commit is contained in:
Eric House 2012-11-08 20:08:20 -08:00
parent 0ef7c8bf46
commit 0f21f849d9

View file

@ -317,6 +317,9 @@ public class NetUtils {
DbgUtils.loge( mue );
} catch ( java.io.IOException ioe ) {
DbgUtils.loge( ioe );
} catch ( Exception ce ) {
// E.g. java.net.ConnectException; we failed
// to download, ok.
} finally {
if ( null != urlConn ) {
urlConn.disconnect();
@ -324,7 +327,10 @@ public class NetUtils {
}
sno.close();
DictLangCache.inval( context, name, loc, true );
if ( success ) {
DictLangCache.inval( context, name, loc, true );
}
if ( null != lstnr ) {
lstnr.downloadFinished( name, success );
}