Commit 80d988db authored by Valentina Kiryushkina's avatar Valentina Kiryushkina
Browse files

Do not show user name and surname if they're null or empty

parent 3e93150f
Branches unavailable Tags unavailable
Showing with 9 additions and 1 deletion
+9 -1
......@@ -96,7 +96,15 @@ public class StudyStepicUserWidget implements IconLikeCustomStatusBarWidget {
createUserPanel("You're not logged in", "Authorize on Stepik", createAuthorizeUserListener());
}
else {
String statusText = "<html>You're logged in as <i>" + user.getFirstName() + " " + user.getLastName() + "</i></html>";
String firstName = user.getFirstName();
String lastName = user.getLastName();
String statusText;
if (firstName == null || lastName == null || firstName.isEmpty() || lastName.isEmpty()) {
statusText = "You're logged in";
}
else {
statusText = "<html>You're logged in as <i>" + firstName + " " + lastName + "</i></html>";
}
createUserPanel(statusText, "Log out", createLogoutListener());
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment