Browse Source

fix: guard against undefined from empty array unwrap in fal provider

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 5 months ago
parent
commit
588b08d02b
  1. 4
      src/app/api/generate/providers/fal.ts

4
src/app/api/generate/providers/fal.ts

@ -279,7 +279,9 @@ export async function generateWithFalQueue(
filteredInputs[key] = [processedValue]; filteredInputs[key] = [processedValue];
} else if (!schemaArrayParams.has(key) && Array.isArray(processedValue)) { } else if (!schemaArrayParams.has(key) && Array.isArray(processedValue)) {
// Unwrap array to single value if schema expects a string (e.g. image_url) // Unwrap array to single value if schema expects a string (e.g. image_url)
filteredInputs[key] = processedValue[0]; if (processedValue.length > 0) {
filteredInputs[key] = processedValue[0];
}
} else { } else {
filteredInputs[key] = processedValue; filteredInputs[key] = processedValue;
} }

Loading…
Cancel
Save