Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e4ecf8e authored by Adrian Roos's avatar Adrian Roos
Browse files

Don't crash if there's no QS panel

Bug: 17408080
Change-Id: I4632f3b1f484e2e0870f128031ab23db9c520837
parent 2dbf3eac
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -74,9 +74,11 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener
                    mKeyguardUserSwitcher.show(true /* animate */);
                }
            } else {
                if (mQsPanel != null) {
                    mQsPanel.showDetailAdapter(true,
                            mQsPanel.getHost().getUserSwitcherController().userDetailAdapter);
                }
            }
        } else {
            Intent intent = ContactsContract.QuickContact.composeQuickContactsIntent(
                    getContext(), v, ContactsContract.Profile.CONTENT_URI,
@@ -93,9 +95,12 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener
            final UserManager um = UserManager.get(getContext());
            String text;
            if (um.isUserSwitcherEnabled()) {
                String currentUser = null;
                if (mQsPanel != null) {
                    UserSwitcherController controller = mQsPanel.getHost()
                            .getUserSwitcherController();
                String currentUser = controller.getCurrentUserName(mContext);
                    currentUser = controller.getCurrentUserName(mContext);
                }
                if (TextUtils.isEmpty(currentUser)) {
                    text = mContext.getString(R.string.accessibility_multi_user_switch_switcher);
                } else {