Skip to content

Commit 5637129

Browse files
committed
fix(/suggest/series_country): return an empty string instead of null to fix an error from browser.
Fix #630
1 parent 492a883 commit 5637129

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/ru/mystamps/web/feature/country/SuggestionController.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*/
1818
package ru.mystamps.web.feature.country;
1919

20+
import org.apache.commons.lang3.StringUtils;
21+
2022
import org.springframework.web.bind.annotation.GetMapping;
2123
import org.springframework.web.bind.annotation.RestController;
2224

@@ -33,10 +35,14 @@ class SuggestionController {
3335

3436
/**
3537
* @author John Shkarin
38+
* @author Slava Semushin
3639
*/
3740
@GetMapping(Url.SUGGEST_SERIES_COUNTRY)
3841
public String suggestCountryForUser(@CurrentUser Integer currentUserId) {
39-
return countryService.suggestCountryForUser(currentUserId);
42+
return StringUtils.defaultString(
43+
countryService.suggestCountryForUser(currentUserId),
44+
StringUtils.EMPTY
45+
);
4046
}
4147

4248
}

0 commit comments

Comments
 (0)