summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/_inc/jetpack-jitm.js')
-rw-r--r--plugins/jetpack/_inc/jetpack-jitm.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/jetpack/_inc/jetpack-jitm.js b/plugins/jetpack/_inc/jetpack-jitm.js
index db8f4ab6..c1e156b0 100644
--- a/plugins/jetpack/_inc/jetpack-jitm.js
+++ b/plugins/jetpack/_inc/jetpack-jitm.js
@@ -69,7 +69,8 @@ jQuery( document ).ready( function( $ ) {
query: query,
_wpnonce: $el.data( 'nonce' )
} ).then( function( response ) {
- if ( 0 === response.length ) {
+ // properly handle the case of an empty array or no content set
+ if ( 0 === response.length || ! response[ 0 ].content ) {
return;
}