fix(custom-local-timelines): fix NPE in ended polls. Fixes #110
This commit is contained in:
@@ -92,7 +92,11 @@ public class PollOptionStatusDisplayItem extends StatusDisplayItem{
|
||||
progressBg.setLevel(Math.round(10000f*item.votesFraction));
|
||||
button.setBackground(progressBg);
|
||||
itemView.setSelected(item.isMostVoted);
|
||||
icon.setSelected(item.poll.ownVotes.contains(item.poll.options.indexOf(item.option)));
|
||||
if(item.poll.ownVotes == null){
|
||||
icon.setSelected(false);
|
||||
}else{
|
||||
icon.setSelected(item.poll.ownVotes.contains(item.poll.options.indexOf(item.option)));
|
||||
}
|
||||
icon.setVisibility(item.poll.voted && item.poll.ownVotes.isEmpty() ? View.GONE : View.VISIBLE);
|
||||
percent.setText(String.format(Locale.getDefault(), "%d%%", Math.round(item.votesFraction*100f)));
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user