From f5b8ba49eae0e611669e2f89eb0906b88db6f02c Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Tue, 14 Jul 2020 20:32:17 +0200 Subject: Fix unnecessary 'Couldn't resolve link for' warning --- plugins/base/src/main/kotlin/parsers/MarkdownParser.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt b/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt index 36005d14..05eb71ab 100644 --- a/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt +++ b/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt @@ -118,15 +118,13 @@ class MarkdownParser( declarationDescriptor, null, link.split('.') - ).minBy { it is ClassDescriptor }?.let { DRI.from(it) } + ).minByOrNull { it is ClassDescriptor }?.let { DRI.from(it) } } else null } catch (e1: IllegalArgumentException) { + logger.warn("Couldn't resolve link for $mdLink") null } } - }.also { - if (it == null) - logger.warn("Couldn't resolve link for $mdLink") } private fun referenceLinksHandler(node: ASTNode): DocTag { -- cgit