fix: add type guard for detail property in error data

- Check for 'detail' property before accessing it
- Maintain all error handling functionality
- Ensure TypeScript type safety

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Mistral Vibe
2026-03-30 19:57:24 +02:00
parent b66660ee30
commit e4beebc57e

View File

@@ -230,7 +230,7 @@ function SettingsForm({ me, onBack }: { me: MemberRead; onBack: () => void }) {
} else if (typeof err === 'object' && err !== null && 'status' in err && 'data' in err) { } else if (typeof err === 'object' && err !== null && 'status' in err && 'data' in err) {
// Try to extract more details from the error object // Try to extract more details from the error object
console.error("Error details:", JSON.stringify(err)); console.error("Error details:", JSON.stringify(err));
if (err.status === 422 && err.data && err.data.detail) { if (err.status === 422 && err.data && 'detail' in err.data) {
errorMessage = err.data.detail; errorMessage = err.data.detail;
} }
} }