Skip to content

Commit 1f11ba3

Browse files
dhasani23David Hasani
and
David Hasani
authored
fix(amazonq): skip empty plan tables (#5395)
Co-authored-by: David Hasani <davhasan@amazon.com>
1 parent beabdf1 commit 1f11ba3

File tree

1 file changed

+6
-1
lines changed
  • plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/plan

1 file changed

+6
-1
lines changed

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/plan/CodeModernizerPlanEditor.kt

+6-1
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,15 @@ class CodeModernizerPlanEditor(val project: Project, private val virtualFile: Vi
395395

396396
val table = tableMapping[step.id()]
397397

398-
val parsedTable = table?.let {
398+
var parsedTable = table?.let {
399399
MAPPER.readValue<PlanTable>(it)
400400
}
401401

402+
if (parsedTable?.rows?.isEmpty() == true) {
403+
descriptionText.text += "\n\nThere are no ${parsedTable.name.lowercase()} to display."
404+
parsedTable = null
405+
}
406+
402407
val renderedStepTable = parsedTable?.let {
403408
createTable(it)
404409
}

0 commit comments

Comments
 (0)