mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Bugfix/null revision in review (#3309)
* Fixes #3305 * Handle null firstRevision * initialise explanation
This commit is contained in:
parent
959b3afd4c
commit
824d6ac05e
1 changed files with 8 additions and 3 deletions
|
|
@ -76,7 +76,7 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
|
|||
false);
|
||||
ButterKnife.bind(this, layoutView);
|
||||
|
||||
String question, explanation, yesButtonText, noButtonText;
|
||||
String question, explanation=null, yesButtonText, noButtonText;
|
||||
switch (position) {
|
||||
case SPAM:
|
||||
question = getString(R.string.review_spam);
|
||||
|
|
@ -115,12 +115,17 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
|
|||
|
||||
//Get existing user name if it is already saved using savedInstanceState else get from reviewController
|
||||
if (savedInstanceState == null) {
|
||||
user = getReviewActivity().reviewController.firstRevision.getUser();
|
||||
if (getReviewActivity().reviewController != null) {
|
||||
user = getReviewActivity().reviewController.firstRevision.getUser();
|
||||
}
|
||||
} else {
|
||||
user = savedInstanceState.getString(SAVED_USER);
|
||||
}
|
||||
|
||||
explanation = getString(R.string.review_thanks_explanation, user);
|
||||
//if the user is null because of whatsoever reason, review will not be sent anyways
|
||||
if (!TextUtils.isEmpty(user)) {
|
||||
explanation = getString(R.string.review_thanks_explanation, user);
|
||||
}
|
||||
|
||||
yesButtonText = getString(R.string.review_thanks_yes_button_text);
|
||||
noButtonText = getString(R.string.review_thanks_no_button_text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue