diff --git a/app/src/main/java/com/gamedog/vididin/manager/ZeroManager.kt b/app/src/main/java/com/gamedog/vididin/manager/ZeroManager.kt index 5cf0c35..5a44359 100644 --- a/app/src/main/java/com/gamedog/vididin/manager/ZeroManager.kt +++ b/app/src/main/java/com/gamedog/vididin/manager/ZeroManager.kt @@ -110,10 +110,11 @@ class ZeroManager private constructor() { } } - fun getZeroWithdrawItem(zeroItem: ZeroBuyItem): WinZeroWithdrawInfoItem { + fun getZeroWithdrawItem(zeroItem: ZeroBuyItem): WinZeroWithdrawInfoItem? { try { mRecordLocker.lock() - return mRecordList.filter { zeroItem.id == it.purchase_id }[0] + val matchedList = mRecordList.filter { zeroItem.id == it.purchase_id } + return if (matchedList.isNotEmpty()) matchedList[0] else null } finally { mRecordLocker.unlock() } @@ -273,7 +274,7 @@ class ZeroManager private constructor() { fun startWithdrawProcess(activity: Activity, item: ZeroBuyItem) { val zeroWithdrawInfoItem = getZeroWithdrawItem(item) - if (couldStartWithdraw(item)) { + if (zeroWithdrawInfoItem != null && couldStartWithdraw(item)) { val onConfirmed: (cashNum: Double)->Unit = { requestZeroWithdrawReward(zeroWithdrawInfoItem) } @@ -284,7 +285,7 @@ class ZeroManager private constructor() { WithdrawBindBankDialog(activity = activity, onConfirmed).setWithDrawCashNumStr(zeroWithdrawInfoItem.winCashNumStr!!).show() } } else { - when (zeroWithdrawInfoItem.withdrawState) { + when (zeroWithdrawInfoItem?.withdrawState) { TRANSACTION_STATE_ONGOING -> { AndroidUtil.showToast(R.string.claim_reward_onging) } diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 0aee3f1..daff487 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -51,6 +51,8 @@ Failed Paid There\'s no any data + This purchase reward claim is ongoing. + You have claimed this reward. Finish all tasks to earn! diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 92e9582..2bb158a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -218,8 +218,8 @@ Recompensa! Erro de rede - This purchase reward claim is ongoing. - You have claimed this reward. + Recompensa em recepção + Já receberam recompensas Game Center Not reach withdraw condition You\'ve already withdrawed