Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
user/profile: Fix a server error by an empty daysAgo cookie
Browse files Browse the repository at this point in the history
NumberFormatException was thrown when someone access a user page with an
empty daysAgo cookie.

I don't know when the cookie has a empty value.
  • Loading branch information
Yi EungJun committed Feb 5, 2015
1 parent 37a94fa commit ad3a136
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/UserApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public static Result userInfo(String loginId, String groups, int daysAgo, String

if (daysAgo == UNDEFINED) {
Cookie cookie = request().cookie(DAYS_AGO_COOKIE);
if (cookie != null) {
if (cookie != null && StringUtils.isNotEmpty(cookie.value())) {
daysAgo = Integer.parseInt(cookie.value());
} else {
daysAgo = DAYS_AGO;
Expand Down

0 comments on commit ad3a136

Please sign in to comment.