Fix App.js: guard list.find against non-array response
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -188,7 +188,7 @@ function App() {
|
||||
async function pickBackground() {
|
||||
try {
|
||||
const res = await axios.get('/api/gmkit/list');
|
||||
const list = res.data || [];
|
||||
const list = Array.isArray(res.data) ? res.data : [];
|
||||
if (!mounted) return;
|
||||
// prefer explicit deathwatch-banner.png if present
|
||||
const banner = list.find(f => f.name === 'deathwatch-banner.png');
|
||||
|
||||
Reference in New Issue
Block a user