Merge pull request #2002 from nextcloud/bugfix/1976/fixNPE

avoid NPE
This commit is contained in:
Andy Scherzinger 2022-05-07 12:49:42 +02:00 committed by GitHub
commit 0de1e6e44d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -715,9 +715,13 @@ public class ConversationsListController extends BaseController implements Searc
});
recyclerView.setOnTouchListener((v, event) -> {
InputMethodManager imm =
(InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
if (isAttached() && (!isBeingDestroyed() || !isDestroyed())) {
InputMethodManager imm =
(InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null) {
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
}
return false;
});