Skip to content

Commit

Permalink
Fix NPE in list commands action
Browse files Browse the repository at this point in the history
  • Loading branch information
pplam committed Sep 19, 2024
1 parent db427d2 commit 961bc10
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class ListCommandsRequestHandler(project: Project, requestAction: String, metada
) {
override val actionName: String = DevChatActions.LIST_COMMANDS_RESPONSE
override fun action() {
val recommendedWorkflows = client!!.getWorkflowConfig()?.recommend?.workflows.orEmpty()
val indexedCommands = client.getWorkflowList()?.map {
val recommendedWorkflows = client?.getWorkflowConfig()?.recommend?.workflows.orEmpty()
val indexedCommands = client?.getWorkflowList()?.map {
val commandName = it.name
mapOf(
"name" to it.name,
Expand All @@ -27,7 +27,7 @@ class ListCommandsRequestHandler(project: Project, requestAction: String, metada
),
"recommend" to recommendedWorkflows.indexOf(commandName)
)
}
}.orEmpty()
send(payload = mapOf("commands" to indexedCommands))
}
}

0 comments on commit 961bc10

Please sign in to comment.