Skip to content

Commit

Permalink
fixed NPE when importing data from SO archive, related to #406
Browse files Browse the repository at this point in the history
  • Loading branch information
albogdano committed Oct 11, 2023
1 parent b07cb61 commit 89ccfe6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,8 @@ private void importPostsFromSO(List<Map<String, Object>> objs, List<ParaObject>
if (StringUtils.equalsAnyIgnoreCase((String) obj.get("postType"), "question", "article")) {
p = new Question();
p.setTitle((String) obj.get("title"));
String t = StringUtils.stripStart(StringUtils.stripEnd((String) obj.
getOrDefault("tags", ""), "|"), "|");
String t = StringUtils.trimToEmpty(StringUtils.stripStart(StringUtils.stripEnd((String) obj.
getOrDefault("tags", ""), "|"), "|"));
p.setTags(Arrays.asList(t.split("\\|")));
p.setAnswercount(((Integer) obj.getOrDefault("answerCount", 0)).longValue());
p.setViewcount(((Integer) obj.getOrDefault("viewCount", 0)).longValue());
Expand Down

0 comments on commit 89ccfe6

Please sign in to comment.