From a85e561863533e5b6665a48f29dbc1cf64bda6eb Mon Sep 17 00:00:00 2001 From: FatttSnake Date: Wed, 17 Jul 2024 15:37:02 +0800 Subject: [PATCH] Fix(Tool): Fixed the bug of getting tool exception when tool desc is null --- .../main/kotlin/top/fatweb/oxygen/toolbox/model/tool/Tool.kt | 2 +- .../kotlin/top/fatweb/oxygen/toolbox/network/model/ToolVo.kt | 2 +- .../kotlin/top/fatweb/oxygen/toolbox/ui/component/ToolCard.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/top/fatweb/oxygen/toolbox/model/tool/Tool.kt b/app/src/main/kotlin/top/fatweb/oxygen/toolbox/model/tool/Tool.kt index 86318e8..0da968c 100644 --- a/app/src/main/kotlin/top/fatweb/oxygen/toolbox/model/tool/Tool.kt +++ b/app/src/main/kotlin/top/fatweb/oxygen/toolbox/model/tool/Tool.kt @@ -13,7 +13,7 @@ data class Tool( val platform: Platform, - val description: String, + val description: String? = null, val base: String? = null, diff --git a/app/src/main/kotlin/top/fatweb/oxygen/toolbox/network/model/ToolVo.kt b/app/src/main/kotlin/top/fatweb/oxygen/toolbox/network/model/ToolVo.kt index 2271770..d850e1a 100644 --- a/app/src/main/kotlin/top/fatweb/oxygen/toolbox/network/model/ToolVo.kt +++ b/app/src/main/kotlin/top/fatweb/oxygen/toolbox/network/model/ToolVo.kt @@ -18,7 +18,7 @@ data class ToolVo( val platform: ToolBaseVo.Platform, - val description: String, + val description: String? = null, val base: ToolBaseVo? = null, diff --git a/app/src/main/kotlin/top/fatweb/oxygen/toolbox/ui/component/ToolCard.kt b/app/src/main/kotlin/top/fatweb/oxygen/toolbox/ui/component/ToolCard.kt index 37eed9e..a6b603d 100644 --- a/app/src/main/kotlin/top/fatweb/oxygen/toolbox/ui/component/ToolCard.kt +++ b/app/src/main/kotlin/top/fatweb/oxygen/toolbox/ui/component/ToolCard.kt @@ -49,7 +49,7 @@ fun ToolCard( ToolInfo( toolName = tool.name, toolId = tool.toolId, - toolDesc = tool.description + toolDesc = tool.description ?: "" ) Spacer(modifier = Modifier.height(16.dp)) AuthorInfo(