From e8d39182a0cb47b0cc1b74627306610c01950876 Mon Sep 17 00:00:00 2001 From: Martin Ndegwa Date: Wed, 23 Sep 2020 18:24:59 +0300 Subject: [PATCH 1/2] Fix logout login exception - Fix bug log out causing crash on re-login --- gradle.properties | 2 +- .../org/smartregister/login/interactor/BaseLoginInteractor.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0a337f6a1..3591b774a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=2.1.3-SNAPSHOT +VERSION_NAME=2.1.4-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Core Application diff --git a/opensrp-app/src/main/java/org/smartregister/login/interactor/BaseLoginInteractor.java b/opensrp-app/src/main/java/org/smartregister/login/interactor/BaseLoginInteractor.java index 42c3d0221..f6e354035 100644 --- a/opensrp-app/src/main/java/org/smartregister/login/interactor/BaseLoginInteractor.java +++ b/opensrp-app/src/main/java/org/smartregister/login/interactor/BaseLoginInteractor.java @@ -230,7 +230,7 @@ public BaseLoginContract.View getLoginView() { } public UserService getUserService() { - return mLoginPresenter.getOpenSRPContext().userService(); + return CoreLibrary.getInstance().context().userService(); } /** From 55b8d062bffb0bc92562b525966a2e22bbff4af7 Mon Sep 17 00:00:00 2001 From: Martin Ndegwa Date: Wed, 23 Sep 2020 18:57:11 +0300 Subject: [PATCH 2/2] Add check for null login presenter --- .../smartregister/login/interactor/BaseLoginInteractor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/opensrp-app/src/main/java/org/smartregister/login/interactor/BaseLoginInteractor.java b/opensrp-app/src/main/java/org/smartregister/login/interactor/BaseLoginInteractor.java index f6e354035..ec3a5374f 100644 --- a/opensrp-app/src/main/java/org/smartregister/login/interactor/BaseLoginInteractor.java +++ b/opensrp-app/src/main/java/org/smartregister/login/interactor/BaseLoginInteractor.java @@ -109,7 +109,10 @@ private void localLogin(WeakReference view, String userN private void navigateToHomePage(String userName) { getUserService().localLoginWith(userName); - getLoginView().goToHome(false); + + if (mLoginPresenter != null) { + getLoginView().goToHome(false); + } CoreLibrary.getInstance().initP2pLibrary(userName);