Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/null revision in review #3309

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
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
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);
Expand Down Expand Up @@ -115,12 +115,17 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,

//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);
Expand Down