File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -691,7 +691,7 @@ public function register_in_wp( $assets = null ) {
691691 )
692692 ) {
693693 // Registering the asset now would trigger a doing_it_wrong notice: queue the assets to be registered later.
694- if ( $ assets === null ) {
694+ if ( $ assets === null || empty ( $ assets ) ) {
695695 return ;
696696 }
697697
@@ -711,14 +711,18 @@ public function register_in_wp( $assets = null ) {
711711 return ;
712712 }
713713
714- if ( is_null ( $ assets ) ) {
714+ if ( null === $ assets ) {
715715 $ assets = $ this ->get ();
716716 }
717717
718718 if ( ! is_array ( $ assets ) ) {
719719 $ assets = [ $ assets ];
720720 }
721721
722+ if ( empty ( $ assets ) ) {
723+ return ;
724+ }
725+
722726 foreach ( $ assets as $ asset ) {
723727 if ( ! $ asset instanceof Asset ) {
724728 throw new InvalidArgumentException ( 'Assets in register_in_wp() must be of type Asset ' );
You can’t perform that action at this time.
0 commit comments