public static function ensureFeed($feeduri)
{
$current = self::getKV('uri', $feeduri);
- if ($current) {
+ if ($current instanceof FeedSub) {
return $current;
}
$feedsub->modified = common_sql_now();
$result = $feedsub->insert();
- if (empty($result)) {
+ if ($result === false) {
throw new FeedDBException($feedsub);
}