diff --git a/core/Requirement/Openai_item.php b/core/Requirement/Openai_item.php index f420ad6..eb9c2e6 100644 --- a/core/Requirement/Openai_item.php +++ b/core/Requirement/Openai_item.php @@ -362,8 +362,11 @@ public function handle_ajax_request() { // Extract Yes/No response $yes_no_response = ''; + if (preg_match('/^(Yes|No):/i', $api_content, $matches)) { - $yes_no_response = strtolower(trim($matches[1])); + if (isset($matches[1])) { + $yes_no_response = strtolower(trim($matches[1])); + } } if (in_array($yes_no_response, ['yes', 'no'])) {