Widgets: Avoid a TypeError when adding a widget in the Customizer.

This fixes a bug where `action` is set to `null` when adding a widget in the Customizer.

Fixes . See , .

git-svn-id: https://develop.svn.wordpress.org/trunk@51238 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2021-06-25 14:49:34 +00:00
parent e27b245ea6
commit a3acf737e1

@ -120,6 +120,8 @@ window.wp = window.wp || {};
var context = this;
deferred.done( function() {
if (
action &&
action.data &&
'query-attachments' === action.data.action &&
deferred.jqXHR.hasOwnProperty( 'getResponseHeader' ) &&
deferred.jqXHR.getResponseHeader( 'X-WP-Total' )