Fixed crash when adding tunnel to empty list
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
0.9.26
|
0.9.26
|
||||||
* Fixed "I2CP already listening" bug
|
* Fixed "I2CP already listening" bug
|
||||||
|
* Fixed crash when adding tunnel to empty list
|
||||||
|
|
||||||
0.9.25 / 2016-04-17 / 46d45a878a2b73394b26ca27dbe6c696dedcf1c3
|
0.9.25 / 2016-04-17 / 46d45a878a2b73394b26ca27dbe6c696dedcf1c3
|
||||||
* Fixed a bug on Samsung Android 4.2 devices
|
* Fixed a bug on Samsung Android 4.2 devices
|
||||||
|
@ -65,8 +65,13 @@ public class TunnelEntryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addTunnel(TunnelEntry tunnel) {
|
public void addTunnel(TunnelEntry tunnel) {
|
||||||
|
boolean wasEmpty = mTunnels.isEmpty();
|
||||||
mTunnels.add(tunnel);
|
mTunnels.add(tunnel);
|
||||||
notifyItemInserted(mTunnels.size()-1);
|
if (wasEmpty) {
|
||||||
|
notifyDataSetChanged();
|
||||||
|
} else {
|
||||||
|
notifyItemInserted(mTunnels.size() - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public TunnelEntry getTunnel(int position) {
|
public TunnelEntry getTunnel(int position) {
|
||||||
|
Reference in New Issue
Block a user