Do not crash when trying to upload multiple files

Change-Id: Ibe4fe6b7518f9634fc0d9ce8bda9ccbd9ee9c30d
GitHub: https://github.com/wikimedia/apps-android-commons/pull/30
This commit is contained in:
YuviPanda 2013-07-16 16:17:53 +00:00 committed by SuchABot
parent d5c90801c5
commit 0c381ed928

View file

@ -56,6 +56,13 @@ public class StartUploadTask extends AsyncTask<Void, Void, Contribution> {
this.uploadService = uploadService;
this.contribution = contribution;
// Set things that have not been set!
if(contribution.getLicense() == null) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String license = prefs.getString(Prefs.DEFAULT_LICENSE, Prefs.Licenses.CC_BY_SA);
contribution.setLicense(license);
}
app = (CommonsApplication)context.getApplicationContext();
}