Skip to content

Commit

Permalink
add default value for prompt on error response (#41551)
Browse files Browse the repository at this point in the history
  • Loading branch information
CGastrell authored Feb 4, 2025
1 parent f76a62e commit dd9b704
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Jetpack AI: featured image will try to set a null prompt when quota is exceeded. This patch sets a default value (empty string) on those cases
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export default function FeaturedImage( {
const response = await handleGenerate( { userPrompt: '', style: guessedStyle } );
if ( response ) {
debug( 'handleFirstGenerate', response.revisedPrompt );
setPrompt( response.revisedPrompt );
setPrompt( response.revisedPrompt || '' );
}
}, [ currentPointer, handleGenerate, handleGuessStyle ] );

Expand Down

0 comments on commit dd9b704

Please sign in to comment.