From 6aa0ad9896ce81db7d14439579c38ade7a449562 Mon Sep 17 00:00:00 2001 From: Nazmus Sakib Date: Fri, 12 Dec 2025 10:11:11 +0600 Subject: [PATCH] Fix: Handle null content_type in hasErrorClickhouse() --- src/Statement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Statement.php b/src/Statement.php index 9701d51..4253db4 100644 --- a/src/Statement.php +++ b/src/Statement.php @@ -152,8 +152,8 @@ private function parseErrorClickHouse(string $body) return false; } - private function hasErrorClickhouse(string $body, string $contentType): bool { - if (false === stripos($contentType, 'application/json')) { + private function hasErrorClickhouse(string $body, ?string $contentType): bool { + if ($contentType === null || false === stripos($contentType, 'application/json')) { return preg_match(self::CLICKHOUSE_ERROR_REGEX, $body) === 1; }