From 5e5e1f823e9518af0b2b22c43d34f5066bf1fbf5 Mon Sep 17 00:00:00 2001 From: violine1101 Date: Thu, 10 Oct 2024 06:31:59 -0700 Subject: [PATCH] Correctly map comments from anonymous users (#834) --- src/main/kotlin/io/github/mojira/arisa/Executor.kt | 2 +- .../io/github/mojira/arisa/infrastructure/jira/Mappers.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/io/github/mojira/arisa/Executor.kt b/src/main/kotlin/io/github/mojira/arisa/Executor.kt index bcfd4bdb..b2093cbb 100644 --- a/src/main/kotlin/io/github/mojira/arisa/Executor.kt +++ b/src/main/kotlin/io/github/mojira/arisa/Executor.kt @@ -139,7 +139,7 @@ private fun getSearchResultsFromJira( config ) } catch (exception: Exception) { - log.error("Error mapping bug report ${it.key}:" + exception.message + "\n" + exception.stackTrace) + log.error("Error mapping bug report ${it.key}", exception) null } } diff --git a/src/main/kotlin/io/github/mojira/arisa/infrastructure/jira/Mappers.kt b/src/main/kotlin/io/github/mojira/arisa/infrastructure/jira/Mappers.kt index 92be6d1e..6faeb083 100644 --- a/src/main/kotlin/io/github/mojira/arisa/infrastructure/jira/Mappers.kt +++ b/src/main/kotlin/io/github/mojira/arisa/infrastructure/jira/Mappers.kt @@ -219,7 +219,7 @@ fun JiraComment.toDomain( return Comment( id, body, - author.toDomain(jiraClient, config), + author?.toDomain(jiraClient, config), updateAuthor?.toDomain(jiraClient, config), { getGroups(jiraClient, author.name).fold({ null }, { it }) }, { if (updateAuthor == null) emptyList() else getGroups(jiraClient, updateAuthor.name).fold({ null }, { it }) },