Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nagaihiroki-git opened this issue Jan 27, 2025 · 0 comments
Open

Comments

@nagaihiroki-git
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant