diff --git a/src/org/kde/kdeconnect/UserInterface/PairingFragment.java b/src/org/kde/kdeconnect/UserInterface/PairingFragment.java index c5fe6225..b848baf7 100644 --- a/src/org/kde/kdeconnect/UserInterface/PairingFragment.java +++ b/src/org/kde/kdeconnect/UserInterface/PairingFragment.java @@ -99,6 +99,11 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb @Override public void run() { + if (!isAdded()) { + //Fragment is not attached to an activity. We will crash if we try to do anything here. + return; + } + if (listRefreshCalledThisFrame) { // This makes sure we don't try to call list.getFirstVisiblePosition() // twice per frame, because the second time the list hasn't been drawn