mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Fix crash while uploading image with whitespace title (#1636)
This commit is contained in:
parent
1dc0a7c257
commit
18b0517fc7
1 changed files with 3 additions and 3 deletions
|
|
@ -74,13 +74,13 @@ public class SingleUploadFragment extends CommonsDaggerSupportFragment {
|
||||||
//What happens when the 'submit' icon is tapped
|
//What happens when the 'submit' icon is tapped
|
||||||
case R.id.menu_upload_single:
|
case R.id.menu_upload_single:
|
||||||
|
|
||||||
if (titleEdit.getText().toString().isEmpty()) {
|
if (titleEdit.getText().toString().trim().isEmpty()) {
|
||||||
Toast.makeText(getContext(), R.string.add_title_toast, Toast.LENGTH_LONG).show();
|
Toast.makeText(getContext(), R.string.add_title_toast, Toast.LENGTH_LONG).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
String title = titleEdit.getText().toString();
|
String title = titleEdit.getText().toString().trim();
|
||||||
String desc = descEdit.getText().toString();
|
String desc = descEdit.getText().toString().trim();
|
||||||
|
|
||||||
//Save the title/desc in short-lived cache so next time this fragment is loaded, we can access these
|
//Save the title/desc in short-lived cache so next time this fragment is loaded, we can access these
|
||||||
prefs.edit()
|
prefs.edit()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue