Skip to content

getHangoutLink() returns null character instead of empty string #2655

Open
@nagaihiroki-git

Description

@nagaihiroki-git

Environment details

  • OS: Linux
  • PHP version: 8.2
  • Package name and version: google/apiclient v2.18.2

Steps to reproduce

  1. Create a Google Calendar service instance
  2. Attempt to get an event using events->get() method
  3. Try to access the Hangout link using getHangoutLink()
  4. Observe that getHangoutLink() returns a null character instead of an empty string

Code example

$service = $this->createGoogleService();
$event = $service->events->get($calendarId, $eventId);

// Debug output showing the issue
echo 'shouldGenMeetingUrsssl: ' . ($event->getHangoutLink() !== "") . "\n"; // false
echo 'shouldGenMeetingUrl: ' . $event->getHangoutLink() . "\n"; // 
echo 'isNULL: ' . ($event->getHangoutLink() === null) . "\n"; // true
echo 'isEmptyString: ' . ($event->getHangoutLink() === "") . "\n"; //false

Expected behavior

The getHangoutLink() method should return an empty string ("") when no Hangout link is present, according to the API documentation.

Actual behavior

The getHangoutLink() method returns a null character (\0), not an empty string ("") or PHP null value. This causes unexpected behavior with string comparisons and can lead to subtle bugs in string handling code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions