Skip to content

Commit 19c376c

Browse files
committed
Added guard to handle missing content-type
1 parent d0b90fe commit 19c376c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Annotations/AnnotationGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ protected function getExampleIfAvailable(string $url, bool $useLocalToken = fals
890890
|| stripos($response['data'], '<result />') !== false
891891
|| trim($response['data']) === '[]'
892892
|| (stripos($url, 'format=tsv') !== false && trim($response['data']) === 'No data available')
893-
|| !preg_match("/(json|xml|tsv)/", $response['headers']['content-type']) // Some ask for xml/json/tsv but return image/png, shouldn't be treated as xml
893+
|| !preg_match("/(json|xml|tsv)/", $response['headers']['content-type'] ?? '') // Some ask for xml/json/tsv but return image/png, shouldn't be treated as xml
894894
) {
895895
return '';
896896
}

0 commit comments

Comments
 (0)