Zend certified PHP/Magento developer

Magento Error Warning: Undefined property: stdClass::items in ORN.php

enter image description here

Response validation: Before accessing the items[0] property of the response object, it is important to check if the items array is empty to avoid errors.

/**
     * @throws Exception
     */
    private function getContact(ORNInterface $orn, $returnId=false)
    {
        try {
            $requestData = json_decode($orn->getRequest());
            $queryUrl = "select id from contacts where contacts.emails.address='" . $requestData->email ."'";
            $query = "queryResults?query=" . urlencode($queryUrl);
            $this->addHeaders();
            $this->curl->get($this->ornConfigData->url . $query);
            $response = json_decode($this->curl->getBody());
            $responseItems = $response->items[0];
         
            if($responseItems->count > 0) {
                if($returnId) {
                    return $responseItems->rows[0][0];
                } else {
                    return true;
                }
            }

            return false;
        } catch (Exception $e) {
            $this->logger->info($e->getMessage());
            $this->messageManager->addErrorMessage($e->getMessage());
        }
    }