The Unified and Autonomous Development Platform
Fix issue #1067 - NPE when importing projects from YouTrack
Robin Shen6d01037f8c73
diff --git a/server-plugin/server-plugin-import-youtrack/src/main/java/io/onedev/server/plugin/imports/youtrack/ImportServer.java b/server-plugin/server-plugin-import-youtrack/src/main/java/io/onedev/server/plugin/imports/youtrack/ImportServer.javaindex f4039162fe..f60901f5ae 100644--- a/server-plugin/server-plugin-import-youtrack/src/main/java/io/onedev/server/plugin/imports/youtrack/ImportServer.java+++ b/server-plugin/server-plugin-import-youtrack/src/main/java/io/onedev/server/plugin/imports/youtrack/ImportServer.java@@ -895,8 +895,12 @@ public class ImportServer implements Serializable, Validatable {List<JsonNode> attachmentNodes = new ArrayList<>();for (JsonNode attachmentNode: commentNode.get("attachments"))attachmentNodes.add(attachmentNode);- comment.setContent(processAttachments(issue.getUUID(), readableId,- commentContent, attachmentNodes, tooLargeAttachments));+ String processedContent = processAttachments(issue.getUUID(), readableId,+ commentContent, attachmentNodes, tooLargeAttachments);+ if (processedContent != null)+ comment.setContent(processedContent);+ else+ continue;}comment.setDate(new Date(commentNode.get("created").asLong(System.currentTimeMillis())));if (commentNode.hasNonNull("author")) {