mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-07-08 12:50:29 +03:00
Fix #148 - Crashes when fragment not attached
This commit is contained in:
parent
fa100ab277
commit
640a725495
1 changed files with 3 additions and 3 deletions
|
@ -481,9 +481,6 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
* @param direction - DIRECTION null if first call, then is set to TOP or BOTTOM depending of scroll
|
* @param direction - DIRECTION null if first call, then is set to TOP or BOTTOM depending of scroll
|
||||||
*/
|
*/
|
||||||
private void route(DIRECTION direction, boolean fetchingMissing) {
|
private void route(DIRECTION direction, boolean fetchingMissing) {
|
||||||
if (!isAdded()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
QuickLoad quickLoad = new QuickLoad(requireActivity()).getSavedValue(MainActivity.currentUserID, MainActivity.currentInstance, timelineType, ident);
|
QuickLoad quickLoad = new QuickLoad(requireActivity()).getSavedValue(MainActivity.currentUserID, MainActivity.currentInstance, timelineType, ident);
|
||||||
if (binding == null) {
|
if (binding == null) {
|
||||||
|
@ -501,6 +498,9 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
} else {
|
} else {
|
||||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
Runnable myRunnable = () -> {
|
Runnable myRunnable = () -> {
|
||||||
|
if (!isAdded()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// --- HOME TIMELINE ---
|
// --- HOME TIMELINE ---
|
||||||
if (timelineType == Timeline.TimeLineEnum.HOME) {
|
if (timelineType == Timeline.TimeLineEnum.HOME) {
|
||||||
//for more visibility it's done through loadHomeStrategy method
|
//for more visibility it's done through loadHomeStrategy method
|
||||||
|
|
Loading…
Reference in a new issue