Skip to content

Commit 43bee7c

Browse files
committed
fix officerCode is null on login
1 parent 5a53e65 commit 43bee7c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • app/src/main/java/org/openimis/imispolicies/usecase

app/src/main/java/org/openimis/imispolicies/usecase/Login.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ public Login(
5353

5454
@WorkerThread
5555
public void execute(@NonNull String username, @NonNull String password) throws Exception {
56-
String officerCode = Global.getGlobal().getOfficerCode();
56+
String officerCode = (Global.getGlobal().getOfficerCode() != null)
57+
? Global.getGlobal().getOfficerCode()
58+
: username;
59+
5760
if (officerCode == null) {
5861
throw new IllegalStateException("OfficerCode should not be null on login");
5962
}

0 commit comments

Comments
 (0)