mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Check in SingleUploadFragment that spinner position is valid before applying
This commit is contained in:
parent
87fe6cf585
commit
0c5e0869b5
1 changed files with 7 additions and 0 deletions
|
|
@ -115,6 +115,13 @@ public class SingleUploadFragment extends Fragment {
|
|||
licenseSpinner.setAdapter(adapter);
|
||||
|
||||
int position = licenseItems.indexOf(getString(Utils.licenseNameFor(license)));
|
||||
|
||||
// Check position is valid
|
||||
if(position < 0) {
|
||||
Timber.d("Invalid position: %d. Using default license", position);
|
||||
position = 4;
|
||||
}
|
||||
|
||||
Timber.d("Position: %d %s", position, getString(Utils.licenseNameFor(license)));
|
||||
licenseSpinner.setSelection(position);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue