From 07dcc966a09a462e6983dd525b338f405b44cacc Mon Sep 17 00:00:00 2001
From: Abdi Tolessa <41271840+AbdiTolesa@users.noreply.github.com>
Date: Sat, 30 Sep 2023 00:09:59 +0300
Subject: [PATCH] Check if /opt/homebrew/bin /opt/homebrew/sbin /opt/local/bin
 /opt/local/sbin /usr/local/bin /usr/bin /bin /usr/sbin /sbin
 /Users/abditolessa/.local/bin /Users/abditolessa/.composer/vendor/bin
 /Users/abditolessa/.local/bin is null and return false early if so

---
 src/wp-includes/global-styles-and-settings.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/wp-includes/global-styles-and-settings.php b/src/wp-includes/global-styles-and-settings.php
index 1258f1f4e3..f7d5fe0a91 100644
--- a/src/wp-includes/global-styles-and-settings.php
+++ b/src/wp-includes/global-styles-and-settings.php
@@ -409,6 +409,11 @@ function wp_theme_has_theme_json() {
 	/** This filter is documented in wp-includes/link-template.php */
 	$path = apply_filters( 'theme_file_path', $path, 'theme.json' );
 
+	if ( ! $path ) {
+		$theme_has_support[ $stylesheet ] = false;
+		return false;
+	}
+
 	$theme_has_support[ $stylesheet ] = file_exists( $path );
 
 	return $theme_has_support[ $stylesheet ];
-- 
2.32.1 (Apple Git-133)

