Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/idea-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

- [Gutter] Fixed rendering of icons with gradients and Compose colors
- [Gutter] Fixed rendering of icons with fully qualified imports
- [Gutter] Handle exceptions during icon rendering to prevent IDE crashes on unsupported icons
- [IconPack] Fix incorrect initial state of `packageName` field in new pack mode when destination folder is selected
- [IconPack] The IDE didn't automatically display the new icon pack object file

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,21 @@ class ImageVectorIcon(
val maxDimension = ICON_SCALE_FACTOR * size
val errorLog = StringBuilder()

val imageBuffer = VdPreview.getPreviewFromVectorXml(
VdPreview.TargetSize.createFromMaxDimension(maxDimension),
vectorXml,
errorLog,
)
val imageBuffer = try {
VdPreview.getPreviewFromVectorXml(
VdPreview.TargetSize.createFromMaxDimension(maxDimension),
vectorXml,
errorLog,
)
} catch (e: Exception) {
Logger.getInstance(ImageVectorIcon::class.java)
.warn("Failed to render icon preview: ${e.message}")
return null
}

if (errorLog.isNotEmpty()) {
Logger.getInstance(ImageVectorIcon::class.java)
.error("Failed to create icon preview: $errorLog")
.warn("Failed to create icon preview: $errorLog")
}

return imageBuffer
Expand Down
Loading