Skip to content

Commit

Permalink
fix: wrap throw with catch
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit committed Apr 29, 2022
1 parent bf01496 commit d273d71
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions app/src/main/java/cc/ioctl/fragment/DatabaseShrinkFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -115,27 +115,35 @@ class DatabaseShrinkFragment : BaseRootLayoutFragment() {
if (mCurrentUin < 10000) {
return
}
val troops = TroopManagerHelper.getTroopInfoList()
troops?.let {
for (troop in it) {
val uin = troop.troopuin!!
val md5 = uinToMd5(uin)
mMd5ToUinLut[md5] = uin
mTroopName[uin] = troop.troopname
try {
val troops = TroopManagerHelper.getTroopInfoList()
troops?.let {
for (troop in it) {
val uin = troop.troopuin!!
val md5 = uinToMd5(uin)
mMd5ToUinLut[md5] = uin
mTroopName[uin] = troop.troopname
}
}
} catch (e: Exception) {
Log.e(e)
}
val friends = ExfriendManager.get(mCurrentUin).persons
friends?.let {
for (friend in it) {
val uin = friend.key.toString()
var nick = friend.value.remark
if (nick.isNullOrEmpty()) {
nick = friend.value.nick
try {
val friends = ExfriendManager.get(mCurrentUin).persons
friends?.let {
for (friend in it) {
val uin = friend.key.toString()
var nick = friend.value.remark
if (nick.isNullOrEmpty()) {
nick = friend.value.nick
}
val md5 = uinToMd5(uin)
mMd5ToUinLut[md5] = uin
mFriendName[uin] = nick
}
val md5 = uinToMd5(uin)
mMd5ToUinLut[md5] = uin
mFriendName[uin] = nick
}
} catch (e: Exception) {
Log.e(e)
}
}

Expand Down

0 comments on commit d273d71

Please sign in to comment.