avoid GPX segemnt color NPE

This commit is contained in:
sonora 2015-11-29 19:48:45 +01:00
parent a9d7fda55a
commit f0e11a584b

View file

@ -335,7 +335,7 @@ public class SelectedGPXFragment extends OsmAndListFragment {
public void onClick(DialogInterface dialog, int which) {
SelectedGpxFile sf = app.getSelectedGpxHelper().selectGpxFile(getGpx(), vis.isChecked(), false);
int clr = list.get(colorSpinner.getSelectedItemPosition());
if(clr != 0 && sf.getModifiableGpxFile() != null) {
if(!vis.isChecked() && clr != 0 && sf.getModifiableGpxFile() != null) {
sf.getModifiableGpxFile().setColor(clr);
sf.processPoints();
}