<?php

final class FeedPublisherWorker extends FeedPushWorker {

  protected function doWork() {
    $story = $this->loadFeedStory();

    $uris = PhabricatorEnv::getEnvConfig('feed.http-hooks');
    foreach ($uris as $uri) {
      $this->queueTask(
        'FeedPublisherHTTPWorker',
        array(
          'key' => $story->getChronologicalKey(),
          'uri' => $uri,
        ));
    }

    $argv = array(
      array(),
    );

    // Find and schedule all the enabled Doorkeeper publishers.
    $doorkeeper_workers = id(new PhutilSymbolLoader())
      ->setAncestorClass('DoorkeeperFeedWorker')
      ->loadObjects($argv);
    foreach ($doorkeeper_workers as $worker) {
      if (!$worker->isEnabled()) {
        continue;
      }
      $this->queueTask(
        get_class($worker),
        array(
          'key' => $story->getChronologicalKey(),
        ));
    }
  }


}

<?php

final class FeedPublisherWorker extends FeedPushWorker {

  protected function doWork() {
    $story = $this->loadFeedStory();

    $uris = PhabricatorEnv::getEnvConfig('feed.http-hooks');

    if ($uris) {
      foreach ($uris as $uri) {
        $this->queueTask(
          'FeedPublisherHTTPWorker',
          array(
            'key' => $story->getChronologicalKey(),
            'uri' => $uri,
          ));
      }
    }

    $argv = array(
      array(),
    );

    // Find and schedule all the enabled Doorkeeper publishers.
    $doorkeeper_workers = id(new PhutilSymbolLoader())
      ->setAncestorClass('DoorkeeperFeedWorker')
      ->loadObjects($argv);
    foreach ($doorkeeper_workers as $worker) {
      if (!$worker->isEnabled()) {
        continue;
      }
      $this->queueTask(
        get_class($worker),
        array(
          'key' => $story->getChronologicalKey(),
        ));
    }
  }


}

Fix an issue with handling of `null` feed URIs
Fix an issue with handling of `null` feed URIs

Summary: Ref T8658. Caught this in the logs. This value may be set to `null`. Handle that gracefully.

Test Plan: Will check logs.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8658

Differential Revision: https://secure.phabricator.com/D13432
