Commit 5ec1ad4
committed
Resolves [FR-2069](https://lablup.atlassian.net/browse/FR-2069)
## Summary
Prevent React error page when saving empty or invalid JSON in the Theme JSON Configuration modal on the branding page.
## Changes
- Add try-catch error handling for `JSON.parse(editorValue)` in both OK and Export button handlers
- Display user-friendly error message instead of crashing with uncaught `SyntaxError`
- Affected file: `react/src/components/BrandingSettingItems/ThemeJsonConfigModal.tsx`
## Before
- Saving empty editor content caused uncaught `JSON.parse` error → React error page
- Export with invalid JSON crashed the page
## After
- Invalid JSON shows error message: "Cannot apply invalid JSON config"
- Monaco schema validation still works for structure errors
- No more error pages on empty/invalid JSON input
**Checklist:**
- [x] Bug fix - no documentation needed
- [x] No manager version requirements
- [x] Test: Open branding page → JSON Config modal → Clear all content → Click OK/Export → See error message instead of crash
[FR-2069]: https://lablup.atlassian.net/browse/FR-2069?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent b4b3c7d commit 5ec1ad4
1 file changed
Lines changed: 18 additions & 2 deletions
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
109 | 117 | | |
110 | | - | |
| 118 | + | |
111 | 119 | | |
112 | 120 | | |
113 | 121 | | |
| |||
128 | 136 | | |
129 | 137 | | |
130 | 138 | | |
131 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
132 | 148 | | |
133 | 149 | | |
134 | 150 | | |
| |||
0 commit comments