forked from upstream-mirrors/OpenTracks
Bug: crash earlier if in IntervalsFragment if the trackId is null.
Belongs to #1156.
This commit is contained in:
@@ -16,6 +16,7 @@ import androidx.lifecycle.ViewModelProvider;
|
|||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import de.dennisguse.opentracks.R;
|
import de.dennisguse.opentracks.R;
|
||||||
import de.dennisguse.opentracks.data.ContentProviderUtils;
|
import de.dennisguse.opentracks.data.ContentProviderUtils;
|
||||||
@@ -59,10 +60,11 @@ public class IntervalsFragment extends Fragment {
|
|||||||
/**
|
/**
|
||||||
* Creates an instance of this class.
|
* Creates an instance of this class.
|
||||||
*
|
*
|
||||||
* @param fromTopToBottom If true then the intervals are shown from top to bottom (the first interval on top). Otherwise the intervals are shown from bottom to top.
|
* @param fromTopToBottom If true then the intervals are shown from top to bottom (the first interval on top). Otherwise the intervals are shown from bottom to top.
|
||||||
* @return IntervalsFragment instance.
|
* @return IntervalsFragment instance.
|
||||||
*/
|
*/
|
||||||
public static Fragment newInstance(Track.Id trackId, boolean fromTopToBottom) {
|
public static Fragment newInstance(@NonNull Track.Id trackId, boolean fromTopToBottom) {
|
||||||
|
Objects.nonNull(trackId);
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putBoolean(FROM_TOP_TO_BOTTOM_KEY, fromTopToBottom);
|
bundle.putBoolean(FROM_TOP_TO_BOTTOM_KEY, fromTopToBottom);
|
||||||
bundle.putParcelable(TRACK_ID_KEY, trackId);
|
bundle.putParcelable(TRACK_ID_KEY, trackId);
|
||||||
|
|||||||
Reference in New Issue
Block a user