fix NPE in SelectedGPXFragment

This commit is contained in:
sonora 2015-11-29 14:03:15 +01:00
parent 9e229455ea
commit 1d5d6430ac

View file

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