diff -Nuar a/vendor/magento/module-theme/Controller/Result/JsFooterPlugin.php b/vendor/magento/module-theme/Controller/Result/JsFooterPlugin.php
index 317ab39d307..6a80dec4606 100644
--- a/vendor/magento/module-theme/Controller/Result/JsFooterPlugin.php
+++ b/vendor/magento/module-theme/Controller/Result/JsFooterPlugin.php
@@ -41,7 +41,7 @@ class JsFooterPlugin
     {
         $content = $subject->getContent();
         $script = [];
-        if (strpos($content, '</body') !== false) {
+        if (is_string($content) && strpos($content, '</body') !== false) {
             if ($this->scopeConfig->isSetFlag(
                 self::XML_PATH_DEV_MOVE_JS_TO_BOTTOM,
                 ScopeInterface::SCOPE_STORE
