WebServiceUtility::getGeolocation can return NULL while the code foreach its result

Created on 16 July 2021, over 3 years ago
Updated 28 November 2024, 24 days ago

Steps to reproduce

Drupal\smart_ip_ipinfodb_web_service\EventSubscriber\SmartIpEventSubscriber::processQuery

public function processQuery(GetLocationEvent $event) {
    if ($event->getDataSource() == self::sourceId()) {
      $location = $event->getLocation();
      $ipAddress = $location->get('ipAddress');
      $record = WebServiceUtility::getGeolocation($ipAddress);
      ....
      // MIssing data exist checking on $record before using it in foreach loop.
      foreach ($record as &$item) {
          ....
      }
🐛 Bug report
Status

Postponed: needs info

Version

4.0

Component

Code

Created by

🇻🇳Vietnam mrddthi

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • heddn Nicaragua

    Drupal 8 & 9 are no longer supported. This version of the module this was opened against only supports these earlier versions of Drupal. If this is still something you want addressed in the current 5.x version of the module, please update and provide some next steps.

Production build 0.71.5 2024