From 0f2ab0483714f860aab97a7ff7439a6d3bd9fe4e Mon Sep 17 00:00:00 2001
From: Alex Barth <alex_b@53995.no-reply.drupal.org>
Date: Tue, 11 Jan 2011 17:31:45 +0000
Subject: [PATCH] Do not node_load() if feed_nid is 0.

---
 plugins/FeedsParser.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plugins/FeedsParser.inc b/plugins/FeedsParser.inc
index 60346d99..43cf1d79 100644
--- a/plugins/FeedsParser.inc
+++ b/plugins/FeedsParser.inc
@@ -125,7 +125,9 @@ abstract class FeedsParser extends FeedsPlugin {
    * @see FeedsCSVParser::getSourceElement().
    */
   public function getSourceElement(FeedsSource $source, FeedsParserResult $result, $element_key) {
-    if (($node = node_load($source->feed_nid)) && $element_key == 'parent:uid') {
+    if ($element_key == 'parent:uid' &&
+        $source->feed_nid &&
+        ($node = node_load($source->feed_nid))) {
       return $node->uid;
     }
     $item = $result->currentItem();
-- 
GitLab