Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions app/src/org/commcare/activities/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -557,15 +557,10 @@ private void checkForSavedCredentials() {

if(appState == ConnectManager.ConnectAppMangement.ConnectId) {
int selectorIndex = uiController.getSelectedAppIndex();
if (selectorIndex > 0) {
String selectedAppId = appIdDropdownList.size() > 0 ? appIdDropdownList.get(selectorIndex) : "";
String selectedAppId = !appIdDropdownList.isEmpty() ? appIdDropdownList.get(selectorIndex) : "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible here for selectorIndex to be -1 i.e. no selection ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I'm aware of. The code for getSelectedAppIndex just calls to the Spinner to get the position, and it sounds like that never returns -1 unless the developer does something fancy like call setSelection(-1), and the only code we have that calls setSelection first contains some logic to ensure that the value is always between 0 and numItems-1.


if (uiController.isAppSelectorVisible() && !selectedAppId.equals(seatedAppId)) {
appState = ConnectManager.ConnectAppMangement.Unmanaged;
}
} else {
//Connect jobs selected from dropdown
appState = ConnectManager.ConnectAppMangement.Connect;
if (uiController.isAppSelectorVisible() && !selectedAppId.equals(seatedAppId)) {
appState = ConnectManager.ConnectAppMangement.Unmanaged;
}
}

Expand Down