forked from upstream-mirrors/OpenTracks
TrackRecordingManager: rather crash than try to load invalid data.
This commit is contained in:
@@ -131,6 +131,10 @@ public class TrackRecordingManager implements SharedPreferences.OnSharedPreferen
|
||||
}
|
||||
|
||||
RecordingData getDataForUI() {
|
||||
if (trackId == null) {
|
||||
throw new RuntimeException("Requesting data if not recording should not be done.");
|
||||
}
|
||||
|
||||
Pair<TrackPoint, SensorDataSet> current = trackPointCreator.createCurrentTrackPoint(lastTrackPointUIWithSpeed, lastTrackPointUIWithAltitude, lastStoredTrackPointWithLocation);
|
||||
TrackPoint trackPoint = current.first;
|
||||
TrackStatisticsUpdater tmpTrackStatisticsUpdater = new TrackStatisticsUpdater(trackStatisticsUpdater, trackPoint);
|
||||
@@ -139,8 +143,7 @@ public class TrackRecordingManager implements SharedPreferences.OnSharedPreferen
|
||||
|
||||
Track track = contentProviderUtils.getTrack(trackId); //Get copy TODO: Avoid re-loading data from DB
|
||||
if (track == null) {
|
||||
Log.w(TAG, "Requesting data if not recording is taking place, should not be done.");
|
||||
return null;
|
||||
throw new RuntimeException("Data could not be loaded for TrackId " + trackId);
|
||||
}
|
||||
|
||||
TrackBuilder trackBuilder = new TrackBuilder(track);
|
||||
|
||||
Reference in New Issue
Block a user