diff --git a/library/think/debug/Html.php b/library/think/debug/Html.php
index b6be7adbe341cde1ee333eec31659e910af07e92..c4a5c86387a9bb15164a13344c3fe3b4d1dc055d 100644
--- a/library/think/debug/Html.php
+++ b/library/think/debug/Html.php
@@ -47,9 +47,9 @@ class Html
$request = Request::instance();
$contentType = $response->getHeader('Content-Type');
$accept = $request->header('accept');
- if (strpos($accept, 'application/json') === 0 || $request->isAjax()) {
+ if ((is_string($accept) && strpos($accept, 'application/json') === 0) || $request->isAjax()) {
return false;
- } elseif (!empty($contentType) && strpos($contentType, 'html') === false) {
+ } elseif (!empty($contentType) && (is_string($contentType) && strpos($contentType, 'html') === false)) {
return false;
}
// 获取基本信息