例外workaround
This commit is contained in:
parent
86093a1e13
commit
f4b116cd27
|
@ -1,5 +1,6 @@
|
||||||
package one.nem.kidshift.wallet;
|
package one.nem.kidshift.wallet;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -172,9 +173,14 @@ public class HistoryItemListAdapter extends RecyclerView.Adapter<HistoryItemList
|
||||||
private int getMonthTotal(HistoryModel historyModel) {
|
private int getMonthTotal(HistoryModel historyModel) {
|
||||||
int total = historyModel.getReward();
|
int total = historyModel.getReward();
|
||||||
int index = historyDataList.getList().indexOf(historyModel) + 1;
|
int index = historyDataList.getList().indexOf(historyModel) + 1;
|
||||||
while (!isFirstOfMonth(this.historyDataList.getList().get(index))) {
|
try {
|
||||||
total += historyModel.getReward();
|
while (!isFirstOfMonth(this.historyDataList.getList().get(index))) {
|
||||||
index++;
|
total += historyModel.getReward();
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
} catch (IndexOutOfBoundsException e) {
|
||||||
|
// 1個しかない場合 Workaround
|
||||||
|
// TODO: 例外をひねり潰すのではなく,そもそも発生しないようにするべき
|
||||||
}
|
}
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user