Title: Fatal Error : /create-theme/theme-zip.php(74): array_merge()
Last modified: April 24, 2024

---

# Fatal Error : /create-theme/theme-zip.php(74): array_merge()

 *  [antibo](https://wordpress.org/support/users/antibo/)
 * (@antibo)
 * [2 years ago](https://wordpress.org/support/topic/fatal-error-create-theme-theme-zip-php74-array_merge/)
 * When I try to export my theme with “export theme”, I get this in debug.log :
 *     ```wp-block-code
       [24-Apr-2024 07:34:43 UTC] PHP Warning: foreach() argument must be of type array|object, null given in /home/MYFOLDER/wp-content/plugins/create-block-theme/admin/create-theme/theme-zip.php on line 40
   
       [24-Apr-2024 07:34:43 UTC] PHP Fatal error: Uncaught TypeError: array_merge(): Argument #2 must be of type array, null given in /home/MYFOLDER/wp-content/plugins/create-block-theme/admin/create-theme/theme-zip.php:74
   
       Stack trace:
   
       #0 /home/MYFOLDER/wp-content/plugins/create-block-theme/admin/create-theme/theme-zip.php(74): array_merge()
   
       #1 /home/MYFOLDER/wp-content/plugins/create-block-theme/includes/class-create-block-theme-api.php(386): Theme_Zip::add_activated_fonts_to_zip()
   
       #2 /home/MYFOLDER/wp-includes/rest-api/class-wp-rest-server.php(1230): Create_Block_Theme_API->rest_export_theme()
   
       #3 /home/MYFOLDER/wp-includes/rest-api/class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request()
   
       #4 /home/MYFOLDER/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch()
   
       #5 /home/MYFOLDER/wp-includes/rest-api.php(428): WP_REST_Server->serve_request()
   
       #6 /home/MYFOLDER/wp-includes/class-wp-hook.php(324): rest_api_loaded()
   
       #7 /home/MYFOLDER/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
   
       #8 /home/MYFOLDER/wp-includes/plugin.php(565): WP_Hook->do_action()
   
       #9 /home/MYFOLDER/wp-includes/class-wp.php(418): do_action_ref_array()
   
       #10 /home/MYFOLDER/wp-includes/class-wp.php(813): WP->parse_request()
   
       #11 /home/MYFOLDER/wp-includes/functions.php(1336): WP->main()
   
       #12 /home/MYFOLDER/wp-blog-header.php(16): wp()
   
       #13 /home/MYFOLDER/index.php(17): require('/home/noru8363/...')
   
       #14 {main}
   
       thrown in /home/MYFOLDER/wp-content/plugins/create-block-theme/admin/create-theme/theme-zip.php on line 74
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [antibo](https://wordpress.org/support/users/antibo/)
 * (@antibo)
 * [2 years ago](https://wordpress.org/support/topic/fatal-error-create-theme-theme-zip-php74-array_merge/#post-17709666)
 * The function get_user_activated_fonts() in plugins/create-block-theme/admin/create-
   theme/theme-fonts.php return null if (! isset( $user_settings[‘typography’][‘
   fontFamilies’][‘custom’] ).
 * But the array_merge() function in plugins/create-block-theme/admin/create-theme/
   theme-zip.php at line 74 need an array to populate $theme_json[‘settings’][‘typography’][‘
   fontFamilies’].
 * So return in plugins/create-block-theme/admin/create-theme/theme-fonts.php should
   be return []; instead of return null;
 *  Plugin Author [Jason Crist](https://wordpress.org/support/users/pbking/)
 * (@pbking)
 * [2 years ago](https://wordpress.org/support/topic/fatal-error-create-theme-theme-zip-php74-array_merge/#post-17720699)
 * I believe this should be fixed in the 2.1.1 release with the following change:
 * [https://github.com/WordPress/create-block-theme/pull/582](https://github.com/WordPress/create-block-theme/pull/582)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Fatal Error : /create-theme/theme-zip.php(74): array_merge()’ is closed
to new replies.

 * ![](https://ps.w.org/create-block-theme/assets/icon-256x256.png?rev=2777957)
 * [Create Block Theme](https://wordpress.org/plugins/create-block-theme/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/create-block-theme/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/create-block-theme/)
 * [Active Topics](https://wordpress.org/support/plugin/create-block-theme/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/create-block-theme/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/create-block-theme/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jason Crist](https://wordpress.org/support/users/pbking/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/fatal-error-create-theme-theme-zip-php74-array_merge/#post-17720699)
 * Status: not resolved