fix: guard Icon src against non-function values to prevent crash

Add defensive check in folds Icon component so that if src is ever
undefined or non-function (root cause unknown, possibly data-dependent),
the SVG renders empty rather than throwing and crashing the whole app.

Also adds postinstall script to re-apply the patch after npm install.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lotus Bot
2026-05-21 19:26:52 -04:00
parent 85d556a2a4
commit 9ebe9410aa
2 changed files with 29 additions and 2 deletions
+3 -2
View File
@@ -1,7 +1,7 @@
{
"name": "lotus-chat",
"version": "4.12.1-lotus",
"description": "Lotus Chat Matrix client for Lotus Guild",
"description": "Lotus Chat \u2014 Matrix client for Lotus Guild",
"main": "index.js",
"type": "module",
"engines": {
@@ -18,7 +18,8 @@
"typecheck": "tsc --noEmit",
"prepare": "husky install",
"commit": "git-cz",
"semantic-release": "semantic-release"
"semantic-release": "semantic-release",
"postinstall": "node scripts/patch-folds.mjs"
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": "eslint",