diff -u b/core/modules/contextual/js/contextual.js b/core/modules/contextual/js/contextual.js --- b/core/modules/contextual/js/contextual.js +++ b/core/modules/contextual/js/contextual.js @@ -163,7 +163,7 @@ // Update all contextual links placeholders whose HTML is cached. var uncachedIDs = _.filter(ids, function initIfCached(contextualID) { var html = storage.getItem('Drupal.contextual.' + contextualID); - if (typeof html === 'string' && html.length > 0) { + if (html && html.length) { // Initialize after the current execution cycle, to make the AJAX // request for retrieving the uncached contextual links as soon as // possible, but also to ensure that other Drupal behaviors have had @@ -192,7 +192,7 @@ // If the rendered contextual links are empty, then the current // user does not have permission to access the associated links: // don't render anything. - if (html.length > 0) { + if (html && html.length) { // Update the placeholders to contain its rendered contextual // links. Usually there will only be one placeholder, but it's // possible for multiple identical placeholders exist on the