Skip to content

Commit a00b9f8

Browse files
committed
fix(devti): handle exception in diff panel creation and update planner icon
- Add exception handling when creating diff panels to prevent crashes - Update planner icon size from 13x16 to 11x13 pixels
1 parent 5ceba0d commit a00b9f8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/patch/DiffLangSketch.kt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,16 @@ class DiffLangSketch(private val myProject: Project, private var patchContent: S
8787
return@invokeLater
8888
}
8989

90-
filePatches.forEach { patch ->
91-
val diffPanel = createDiffPanel(patch)
92-
if (diffPanel != null) {
93-
mainPanel.add(diffPanel.getComponent())
94-
mainPanel.revalidate()
90+
try {
91+
filePatches.forEach { patch ->
92+
val diffPanel = createDiffPanel(patch)
93+
if (diffPanel != null) {
94+
mainPanel.add(diffPanel.getComponent())
95+
mainPanel.revalidate()
96+
}
9597
}
98+
} catch (e: Exception) {
99+
AutoDevNotifications.error(myProject, "Failed to create diff panel: ${e.message}")
96100
}
97101
}
98102
}

core/src/main/resources/icons/planner.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)