mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
Bugfix: NPE.
This commit is contained in:
@@ -68,6 +68,7 @@ public class StatsFragment extends Fragment implements TrackDataListener {
|
||||
private TrackDataHub trackDataHub;
|
||||
private Handler handlerUpdateUI;
|
||||
|
||||
//TODO Initialize immediately and remove in onDestroy()
|
||||
private TrackRecordingServiceConnection trackRecordingServiceConnection;
|
||||
|
||||
private Location lastLocation = null;
|
||||
@@ -237,7 +238,9 @@ public class StatsFragment extends Fragment implements TrackDataListener {
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
trackRecordingServiceConnection.unbind();
|
||||
if (trackRecordingServiceConnection != null) {
|
||||
trackRecordingServiceConnection.unbind();
|
||||
}
|
||||
trackRecordingServiceConnection = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ public class TrackRecordingServiceConnection implements ServiceConnection, Death
|
||||
|
||||
private static final String TAG = TrackRecordingServiceConnection.class.getSimpleName();
|
||||
|
||||
@Deprecated
|
||||
//TODO Always the context of the owner of a service connection (i.e., let it be passed to every call).
|
||||
private final Context context;
|
||||
private final Runnable callback;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user